<Window.Resources>
<DataTemplate x:Key="DataTemplateKey1">
<dxb:BarManagerActionContainer>
<dxb:CreateStandardLayoutAction />
<dxb:InsertMainMenuIfNotExistAction>
<dxb:InsertMainMenuIfNotExistAction.Bar>
<dxb:Bar x:Name="mainMenu"
UseWholeRow="True"
Caption="Main menu">
<dxb:Bar.DockInfo>
<dxb:BarDockInfo ContainerType="Top" />
</dxb:Bar.DockInfo>
</dxb:Bar>
</dxb:InsertMainMenuIfNotExistAction.Bar>
</dxb:InsertMainMenuIfNotExistAction>
<dxb:BarSubItem x:Name="fileBarSubItem"
dxb:BarItemLinkActionBase.TargetType="mainMenu"
dxb:BarItemLinkActionBase.ItemLinkIndex="0"
Content="File" />
<dxb:BarButtonItem x:Name="newBarButtonItem"
dxb:BarItemLinkActionBase.Target="fileBarSubItem"
dxb:BarItemLinkActionBase.ItemLinkIndex="0"
Content="New" />
<dxb:BarButtonItem x:Name="openBarButtonItem"
dxb:BarItemLinkActionBase.Target="fileBarSubItem"
dxb:BarItemLinkActionBase.ItemLinkIndex="1"
Content="Open" />
<dxb:BarButtonItem x:Name="saveBarButtonItem"
dxb:BarItemLinkActionBase.Target="fileBarSubItem"
dxb:BarItemLinkActionBase.ItemLinkIndex="2"
Content="Save" />
<dxb:BarButtonItem x:Name="exitBarButtonItem"
dxb:BarItemLinkActionBase.Target="fileBarSubItem"
dxb:BarItemLinkActionBase.ItemLinkIndex="3"
Content="Exit" />
<dxb:BarSubItem x:Name="helpBarSubItem"
dxb:BarItemLinkActionBase.TargetType="mainMenu"
Content="Help" />
<dxb:BarButtonItem x:Name="aboutBarButtonItem"
dxb:BarItemLinkActionBase.Target="helpBarSubItem"
Content="About" />
</dxb:BarManagerActionContainer>
</DataTemplate>
<DataTemplate x:Key="DataTemplateKey2">
<dxb:BarManagerActionContainer>
<dxb:RemoveBarItemAndLinkAction ItemName="helpBarSubItem" />
<dxb:RemoveBarItemAndLinkAction ItemName="exitBarButtonItem" />
</dxb:BarManagerActionContainer>
</DataTemplate>
</Window.Resources>
<Grid>
<dxb:BarManager CreateStandardLayout="True">
<dxb:BarManager.Controllers>
<dxb:TemplatedBarManagerController
ExecuteBefore="True"
Template="{StaticResource DataTemplateKey1}" />
<dxb:TemplatedBarManagerController
ExecuteBefore="False"
Template="{StaticResource DataTemplateKey2}" />
</dxb:BarManager.Controllers>
<dxb:BarManager.Items>
<dxb:BarCheckItem x:Name="boldBarCheckItem"
Content="Bold" />
<dxb:BarCheckItem x:Name="italicBarCheckItem"
Content="Italic" />
<dxb:BarCheckItem x:Name="underlineBarCheckItem"
Content="Underline" />
</dxb:BarManager.Items>
<dxb:BarManager.Bars>
<dxb:Bar x:Name="formatBar"
Caption="Format Bar">
<dxb:Bar.DockInfo>
<dxb:BarDockInfo
ContainerType="Top"
Row="1" />
</dxb:Bar.DockInfo>
<dxb:Bar.ItemLinks>
<dxb:BarCheckItemLink BarItemName="boldBarCheckItem" />
<dxb:BarCheckItemLink BarItemName="italicBarCheckItem" />
<dxb:BarCheckItemLink BarItemName="underlineBarCheckItem" />
</dxb:Bar.ItemLinks>
</dxb:Bar>
</dxb:BarManager.Bars>
<RichTextBox />
</dxb:BarManager>
</Grid>