Blogs

The One With

Silverlight Menu Control: Customizing Appearance (v9.2)

     

In my previous post I have explained how to customize the appearance of the AgMenu Control. The template for it needs to be updated a bit to properly work with the 9.2 build.

List of changes:

  • AgMenuDefaultStyleHelper, AgSubMenuDefaultStyleHelper and the like have been moved to a separate namespace clr-namespace:DevExpress.AgMenu.DefaultStyle
  • AgMenuItemContentPresenter has been moved to clr-namespace:DevExpress.AgMenu.Internal
  • AgMenuItemContentPresenter.CheckShowing has been renamed to CheckAreaVisibility
  • AgMenuItemContentPresenter.VisualPosition has been renamed to Position

To make it a bit more interesting, I made the template look like the Darkroom Skin

and moved the XAML into a separate file so that it can be reused. To add it to your app, simply merge the AgMenu.xaml into your application resources.

<Application.Resources>

<ResourceDictionary>

            <ResourceDictionary.MergedDictionaries>

                <ResourceDictionary Source="Assets/DevExpress/AgMenu.xaml"/>

            </ResourceDictionary.MergedDictionaries>

</ResourceDictionary>

</Application.Resources>

and then apply it to your AgMenu

<dxm:AgMenu Style="{StaticResource AgMenu;DarkRoom}">

    <dxm:AgMenuItem Header="File">

        <dxm:AgMenuItem Header="New">

            <dxm:AgMenuItem Header="Contact"></dxm:AgMenuItem>

            <dxm:AgMenuItem Header="Database"></dxm:AgMenuItem>

        </dxm:AgMenuItem>

        <dxm:AgMenuItem Header="Edit"></dxm:AgMenuItem>

        <dxm:AgMenuItem Header="Delete"></dxm:AgMenuItem>

    </dxm:AgMenuItem>

    <dxm:AgMenuItem Header="Help">

    </dxm:AgMenuItem>

</dxm:AgMenu>

Download the AgMenu 9.2 Darkroom Template (Right click: Save As…)

Cheers,

Azret

Published Aug 03 2009, 04:51 PM by Azret Botash (DevExpress)
Filed under: ,
Technorati tags: Silverlight, AgMenu
Bookmark and Share

Comments

 

ctodx said:

We're just about to release v2009.2 and it would be a good idea to have an "accumulator"

August 20, 2009 8:29 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.