in
Forums
Blogs
DevExpress.com
Client Center
Support Center
DevExpress Channel

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 (Developer Express)
Filed under: ,
Technorati tags: Silverlight, AgMenu

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

Leave a Comment

(required)  
(optional)
(required)  
Verification code: Required
   
Add
Copyright © 1998-2010 Developer Express Inc.
ALL RIGHTS RESERVED