Disabling 'Dock as Tabbed document' in Avalandock
Presently we have a GUI developed, containing a customized layout using Avalondock 2.0. The layouts have a default context menu that is provided. However, I don't want to have the "Dock as Tabbed document" option.
I'd like to know if there's any way to remove or disable the option in the context menu.
I have come across posts which said I can customize the context menu but I don't want to create a customized context menu since that would make the code a lot more complicated.
That's quite easy: just paste this snippet in your Docking Manager tag:
<avalonDock:DockingManager.AnchorableContextMenu>
<ContextMenu>
<MenuItem Header="Float" Command="{Binding Path=FloatCommand}"/>
<MenuItem Header="Dock" Command="{Binding Path=DockCommand}"/>
<MenuItem Header="Dock as Tabbed Document" Visibility="Collapsed"/>
<MenuItem Header="Auto Hide" Command="{Binding Path=AutoHideCommand}"/>
<MenuItem Header="Hide" Command="{Binding Path=HideCommand}"/>
<MenuItem Header="Close" Command="{Binding Path=CloseCommand}"/>
</ContextMenu>
</avalonDock:DockingManager.AnchorableContextMenu>
And you get rid of the command. No other coding or changes in your project are required.
链接地址: http://www.djcxy.com/p/57396.html上一篇: AvalonDock控件上的添加按钮