Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
360
How to Set Theme for XamMenu
posted

I'm adding a XamMenu to my application, but I can't figure out how to set the theme. Usually you just add

Theme="Office2013"

to the Xaml tag. But that doesn't work here.

Parents
No Data
Reply
  • 1700
    Verified Answer
    Offline posted

    Hello Josh, 

    Instead of using “Theme = Office2013” you can place an instance of  the ThemeManager inside the XamMenu and set the theme there similar to the code Xaml Below:  

    <ig:XamMenu x:Name="menu"  Height="20"  VerticalAlignment="Top" HorizontalAlignment="Left" >
                <ig:ThemeManager.Theme>
                    <ig:MetroTheme />
                </ig:ThemeManager.Theme>
    
                <ig:XamMenuItem Header="File">
                    <ig:XamMenuItem Header="New" />
                    <ig:XamMenuItem Header="Open" />
                    <ig:XamMenuItem Header="Exit" />
                </ig:XamMenuItem>
                <ig:XamMenuItem Header="Edit">
                    <ig:XamMenuItem Header="Cut" />
                    <ig:XamMenuItem Header="Copy" />
                    <ig:XamMenuItem Header="Paste" />
    </ig:XamMenuItem>

    Additionally, this could also be done in code behind, where an instance of the ThemeManager needs to be instantiated and then the SetTheme method needs to be used with arguments the following arguments – control and theme, similarly to the code below:

    ThemeManager.SetTheme(menu, new Office2013Theme());

    Please let me know if you have any questions. 

    Regards,
    Ivan Kitanov

Children
No Data