Welcome to MSDN Blogs Sign in | Join | Help

.net ready !!!

        Maxime Lamure
          MCS France
How to create a cool menu (Mac OS style) with Silverlight ? / Comment créer un menu cool (style Mac OS) en Silverlight ?

[English]

Silverlight contrib alpha 2 has recently been releasing. We can find a “cool menu” control which allows us to easily build a “Mac OS dock bar” menu style.

clip_image002[13]

The CoolMenu control contains items collection, named CoolMenuItemCollection.

Each Item, represented by a CoolMenuItem object, contains a content property which can host any objects type: Image, Video, Rectangle …

The following code illustrates how to use this control:

 

<UserControl x:Class="TestMenu.Page"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml    xmlns:contrib="clr-namespace:SilverlightContrib.Controls;assembly=SilverlightContrib.Controls"    Width="800" Height="600">
  <StackPanel>
    <contrib:CoolMenu x:Name="menu" Height="150">
      <contrib:CoolMenu.Items>
        <contrib:CoolMenuItemCollection>
          <contrib:CoolMenuItem>
            <contrib:CoolMenuItem.Content>
              <Image Source="../Images/Envelope.png"  Margin="5"  />
            </contrib:CoolMenuItem.Content>
          </contrib:CoolMenuItem>
          <contrib:CoolMenuItem>
            <contrib:CoolMenuItem.Content>
              <Image Source="../Images/Find.png"  Margin="5"  />
            </contrib:CoolMenuItem.Content>
          </contrib:CoolMenuItem>
          ...
        </contrib:CoolMenuItemCollection>
      </contrib:CoolMenu.Items>
    </contrib:CoolMenu>
  </StackPanel>
</UserControl>

Silverlight contrib: http://silverlightcontrib.org/

SourceCode : click here

[Français]

La version alpha 2 de silverlight contrib a été récemment publiée. On peut y trouver le contrôle « Cool Menu » qui permet de créer facilement un menu de style « Mac OS dock bar ».

clip_image002[13]

Le contrôle CoolMenu contient une collection d’éléments, nommée CoolMenuItemCollection.

Chaque élément, représenté par un objet CoolMenuItem, possède une propriété « Content » qui peut contenir tout type d’objet : Image, Vidéo, rectangle …

L’exemple de code suivant illustre l’utilisation de ce contrôle :

<UserControl x:Class="TestMenu.Page"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml    xmlns:contrib="clr-namespace:SilverlightContrib.Controls;assembly=SilverlightContrib.Controls"    Width="800" Height="600">
  <StackPanel>
    <contrib:CoolMenu x:Name="menu" Height="150">
      <contrib:CoolMenu.Items>
        <contrib:CoolMenuItemCollection>
          <contrib:CoolMenuItem>
            <contrib:CoolMenuItem.Content>
              <Image Source="../Images/Envelope.png"  Margin="5"  />
            </contrib:CoolMenuItem.Content>
          </contrib:CoolMenuItem>
          <contrib:CoolMenuItem>
            <contrib:CoolMenuItem.Content>
              <Image Source="../Images/Find.png"  Margin="5"  />
            </contrib:CoolMenuItem.Content>
          </contrib:CoolMenuItem>
          ...
        </contrib:CoolMenuItemCollection>
      </contrib:CoolMenu.Items>
    </contrib:CoolMenu>
  </StackPanel>
</UserControl>

Silverlight contrib: http://silverlightcontrib.org/

Code source: ici

Posted: Monday, November 03, 2008 4:58 PM by Maxime LAMURE
Filed under:
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker