Skip to main content
A newer version of this page is available. .

BaseLayoutItem.ContextMenuCustomizationsTemplate Property

Gets or sets a template used to customize menu items in all the affected dock layout items. This is a dependency property.

Namespace: DevExpress.Xpf.Docking

Assembly: DevExpress.Xpf.Docking.v18.2.dll

Declaration

public DataTemplate ContextMenuCustomizationsTemplate { get; set; }

Property Value

Type Description
DataTemplate

A DataTemplate used to customize menu items.

Remarks

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 context menu common customizations for all the 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>
See Also