context menu in bureau blue

Oct 12, 2010 at 2:05 PM

Hi,

I am using the bureau blue theme in my application.

I have created a context menu with some icons, and when I select an item on this menu, the icon is not displayed.

Thanks,

Nov 24, 2010 at 8:59 AM

I'm having exactly the same problem, when I hover the mouse on the MenuItem, the icon disappears.

Nov 24, 2010 at 9:45 AM

Hi Tekk,

I can't recall how many bugs there are with this theme so be aware.

Since I do not know much about styling what I did was used the default context menu, style which it fits good with the rest of the theme.

Nov 24, 2010 at 12:04 PM

Hi Galastur,

thanks for reply, but how did you tell the context menu to use the default style?

Previously I had the theme in App.xaml resources, but now I have it for each window/usercontrol in resources separately - but this is also causing the context menu to style with BurreauBlue.

Nov 24, 2010 at 12:21 PM

So assuming the context menu is in a text block,

 <TextBlock x:Name="myTree">
 <TextBlock.Resources>
<Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
</Style>
 </TextBlock.Resources>
<TextBlock.ContextMenu>
   <ContextMenu>
        <MenuItem Header="Delete" Style="{StaticResource MenuItemStyle}"/>
   </ContextMenu>
</TextBlock.ContextMenu>
</TextBlock>


Hope it helps tekk. Let me know how it goes

 

Nov 24, 2010 at 12:35 PM

Thanks.

Actually, I got to do this from code because the context menu is constructing on the run, so this worked for me:

MenuItem m = new MenuItem();
m.Style = new Style(typeof(MenuItem));