RichEditControl.MenuCustomizations Property

Allows you to customize a menu by adding new items or removing existing ones. This is a dependency property.

Namespace: DevExpress.Xpf.RichEdit

Assembly: DevExpress.Xpf.RichEdit.v20.1.dll

Declaration

public ObservableCollection<RichEditMenuCustomization> MenuCustomizations { get; set; }
Public Property MenuCustomizations As ObservableCollection(Of RichEditMenuCustomization)

Property Value

Type Description
ObservableCollection<RichEditMenuCustomization>

A collection of RichEditMenuCustomization objects.

Examples

This example demonstrates how to use the RichEditMenuCustomization.Customizations property to add custom items to the popup menu of the RichEditControl or remove the existing ones. Use the RichEditMenuCustomization.MenuType property to determine the visual element for which the popup menu is invoked.

<dx:DXWindow.Resources>
    <dxre:RichEditUICommand x:Key="commands" />
</dx:DXWindow.Resources>

<dxb:BarManager x:Name="barManager1" ToolbarGlyphSize="Small">
    <dxb:BarManager.Items>
        <dxb:BarButtonItem
            x:Name="customSymbol"
            Command="{Binding InsertSymbol, Mode=OneTime, Source={StaticResource commands}}"
            Content="Insert Symbol" />
        <dxb:BarButtonItem
            x:Name="customInsertTable"
            Command="{Binding InsertTable, Mode=OneTime, Source={StaticResource commands}}"
            Content="Insert Table" />
        <dxb:BarButtonItem
            x:Name="customShowTableGrid"
            Command="{Binding TableToggleShowGridlines, Mode=OneTime, Source={StaticResource commands}}"
            Content="Show Gridlines" />
        <dxb:BarButtonItem
            x:Name="customSetAllBorders"
            Command="{Binding TableToggleAllBorders, Mode=OneTime, Source={StaticResource commands}}"
            Content="All Borders" />
    </dxb:BarManager.Items>

    <Grid>

        <dxre:RichEditControl x:Name="richEdit" CommandBarStyle="Empty" BarManager="{Binding ElementName=barManager1, Mode=OneTime}" PopupMenuShowing="RichEditPopupMenuShowing">
            <dxre:RichEditControl.MenuCustomizations>
                <dxre:RichEditMenuCustomization>
                    <dxre:RemoveRichEditCommandAction Id="{x:Static dxrecore:RichEditCommandId.CutSelection}"/>
                    <dxb:BarButtonItemLink dxb:BarItemLinkActionBase.ItemLinkIndex="0">
                        <dxb:BarButtonItemLink.BarItemName>
                            customSymbol
                        </dxb:BarButtonItemLink.BarItemName>
                    </dxb:BarButtonItemLink>
                    <dxb:BarButtonItemLink dxb:BarItemLinkActionBase.ItemLinkIndex="1">
                        <dxb:BarButtonItemLink.BarItemName>
                            customInsertTable
                        </dxb:BarButtonItemLink.BarItemName>
                    </dxb:BarButtonItemLink>
                    <dxb:BarItemLinkSeparator dxb:BarItemLinkActionBase.ItemLinkIndex="2"></dxb:BarItemLinkSeparator>
                </dxre:RichEditMenuCustomization>
                <dxre:RichEditMenuCustomization MenuType="TableCell">
                    <dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
                    <dxb:BarButtonItemLink>
                        <dxb:BarButtonItemLink.BarItemName>
                            customShowTableGrid
                        </dxb:BarButtonItemLink.BarItemName>
                    </dxb:BarButtonItemLink>
                    <dxb:BarButtonItemLink>
                        <dxb:BarButtonItemLink.BarItemName>
                            customSetAllBorders
                        </dxb:BarButtonItemLink.BarItemName>
                    </dxb:BarButtonItemLink>
                </dxre:RichEditMenuCustomization>
            </dxre:RichEditControl.MenuCustomizations>
        </dxre:RichEditControl>

</Grid>
</dxb:BarManager>
See Also