wpf-devexpress-dot-xpf-dot-docking-dot-baselayoutitem-7a700bbd.md
Gets or sets a template used to customize menu items in all affected dock layout items. This is a dependency property.
Namespace : DevExpress.Xpf.Docking
Assembly : DevExpress.Xpf.Docking.v25.2.dll
NuGet Package : DevExpress.Wpf.Docking
public DataTemplate ContextMenuCustomizationsTemplate { get; set; }
Public Property ContextMenuCustomizationsTemplate As DataTemplate
| Type | Description |
|---|---|
| DataTemplate |
A DataTemplate used to customize menu items.
|
Use the ContextMenuCustomizationsTemplate property to specify a template used to customize the menu items in all the affected layout items.
<Window x:Class="ContextMenuCustomizationTemplate.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars">
<Grid>
<Grid.Resources>
<!-- Specifies common context menu customizations for all affected dock panels -->
<Style TargetType="dxdo:LayoutPanel">
<Setter Property="ContextMenuCustomizationsTemplate">
<Setter.Value>
<DataTemplate>
<ItemsControl>
<!-- Removes the 'Floating' item -->
<dxb:RemoveBarItemAction ItemName="{x:Static dxdo:DefaultMenuItemNames.Floating}" />
<!-- Adds a separator -->
<dxb:BarItemSeparator />
<!-- Adds a custom bar item -->
<dxb:BarButtonItem Content="Test Bar Item" />
</ItemsControl>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<dxdo:DockLayoutManager>
<dxdo:LayoutGroup>
<dxdo:LayoutPanel Caption="Panel1" />
<dxdo:LayoutPanel Caption="Panel2" />
<dxdo:LayoutPanel Caption="Panel3" />
</dxdo:LayoutGroup>
</dxdo:DockLayoutManager>
</Grid>
</Window>
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ContextMenuCustomizationsTemplate property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-dashboard-how-to-add-custom-caption-menu/CS/WpfDashboardCustomCaptionMenu/MainWindow.xaml#L54
</Setter>
<Setter Property="ContextMenuCustomizationsTemplate">
<Setter.Value>
See Also