Having Ribbon in a window affects WPF ContextMenu in a while

Dec 22, 2010 at 1:26 PM

Hello,

I've got RibbonWindow and Ribbon inside. The rest of the window consist of a couple WPF TreeViews which has regular wpf context menus when user right-clicks on its items. Context menus are defined using data templates. The first time I open any TreeView's context menu it is always shown normally but in a while the context menu starts not showing up at all. During debugging I see that CanExecute of MenuItems are actually invoked and returns true.

Probably the style of Ribbon's context menu somehow affects all context menus in a window because when I manually set an empty style to all my context menus like this <ContextMenu.Style> <Style></Style> </ContextMenu.Style> - the problem has gone.

Thanks!

Coordinator
Dec 24, 2010 at 8:09 AM

That's strange, we need a way to repro it.

Daniel

Feb 19, 2011 at 1:24 PM

If a user control is loaded in the document area made with fluent, regular context menus might not be visible as they should be. A simple way to fix this is to use the fluent context menu. I hope it does support all regular WPF context menu functionality.

Here is sample XAML markup :

<

 

UserControl.ContextMenu

>

 

 

<Fluent:ContextMenu

>

 

 

<StackPanel

>

 

 

<GroupBox

>

 

 

<StackPanel

>

 

 

<RadioButton GroupName="1">One</RadioButton

>

 

 

<RadioButton GroupName="1">Two</RadioButton

>

 

 

<RadioButton GroupName="1">Three</RadioButton

>

 

 

</StackPanel

>

 

 

</GroupBox

>

 

 

</StackPanel

>

 

 

</Fluent:ContextMenu

>

 

 

</UserControl.ContextMenu

>