RichEditControl.CommandProvider Property
Gets or sets a RichEditControl’s command provider. This is a dependency property.
Namespace: DevExpress.Xpf.RichEdit
Assembly: DevExpress.Xpf.RichEdit.v24.2.dll
NuGet Package: DevExpress.Wpf.RichEdit
#Declaration
#Property Value
Type | Description |
---|---|
DevExpress. |
A DevExpress. |
#Remarks
A command provider stores commands used by the integrated ribbon. You can use it to assign a command to a command bar item, as described in the table below.
This example demonstrates how to customize the RichEdit’s integrated Ribbon UI. The tasks and required property settings are listed in the table.
Task | Property Setting | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Use integrated Ribbon UI | Set the Rich | ||||||||||||
Load a document | Specify the Rich | ||||||||||||
Determine the ribbon item name | Element names are the fields of the DevExpress.
| ||||||||||||
Remove a command bar item. | Add a new Remove | ||||||||||||
Modify a command bar item. | Add a new Update | ||||||||||||
Insert a command bar item. | Add a new Insert | ||||||||||||
Create a command to assign to the command bar item. | To obtain a command for binding, specify the Command |
#Example
<dxre:RichEditControl Name="richEditControl1" CommandBarStyle="Ribbon" DocumentSource="{DXBinding '$local:SourceHelper.GetDocumentSource()'}">
<dxre:RichEditControl.RibbonActions>
<dxb:RemoveAction ElementName="{x:Static dxre:DefaultBarItemNames.RibbonPage_Review}"/>
<dxb:RemoveAction ElementName="{x:Static dxre:DefaultBarItemNames.RibbonGroup_PageLayout_PageBackground}"/>
<dxb:RemoveAction ElementName="{x:Static dxre:DefaultBarItemNames.RibbonItem_File_Info_DocumentProperties}"/>
<dxb:RemoveAction ElementName="{x:Static dxre:DefaultBarItemNames.RibbonPage_Review}"/>
<dxb:RemoveAction ElementName="{x:Static dxre:DefaultBarItemNames.RibbonPage_MailMerge}"/>
<dxb:UpdateAction ElementName="{x:Static dxre:DefaultBarItemNames.RibbonPage_View}" PropertyName="IsSelected" Value="True"/>
<dxb:InsertAction Index="2" ContainerName="{x:Static dxre:DefaultBarItemNames.RibbonPage_View}">
<dxr:RibbonPageGroup Caption="Demo">
<dxb:BarButtonItem Content="About"
LargeGlyph="{dx:DXImageOffice2013 Image=Info_32x32.png}"
ItemClick="About_ItemClick"/>
</dxr:RibbonPageGroup>
</dxb:InsertAction>
<dxb:InsertAction Index="7" ContainerName="{x:Static dxre:DefaultBarItemNames.RibbonPage_Insert}">
<dxr:RibbonPageGroup Caption="Comments">
<dxb:BarButtonItem Content="Comment"
LargeGlyph="{dx:DXImage Image=NewComment_32x32.png}"
Command="{Binding RelativeSource={RelativeSource Self}, Path=(dxre:RichEditControl.RichEdit).CommandProvider.NewComment}"/>
</dxr:RibbonPageGroup>
</dxb:InsertAction>
</dxre:RichEditControl.RibbonActions>
</dxre:RichEditControl>