This repository has been archived by the owner on Sep 25, 2023. It is now read-only.
/
MainWindow.xaml
42 lines (42 loc) · 3.13 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<Window x:Class="RichEditToolbarCustomCommandWpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
xmlns:local="clr-namespace:RichEditToolbarCustomCommandWpf"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<ResourceDictionary>
<dxre:RichEditUICommand x:Key="commands" />
</ResourceDictionary>
</Window.Resources>
<Grid>
<dxb:BarManager Name="barManager1" ToolbarGlyphSize="Large">
<dxb:BarManager.Bars>
<dxb:Bar Caption="Common" Name="barCommon">
<dxb:Bar.DockInfo>
<dxb:BarDockInfo ContainerType="Top" />
</dxb:Bar.DockInfo>
<dxb:Bar.ItemLinks>
<dxb:BarButtonItemLink BarItemName="biFileNew" />
<dxb:BarButtonItemLink BarItemName="biFileOpen" />
<dxb:BarButtonItemLink BarItemName="biFileSave" />
<dxb:BarButtonItemLink BarItemName="biFileSaveAs" />
<!--Custom BarButtonItemLink-->
<dxb:BarButtonItemLink BarItemName="biShowWordsCount" />
</dxb:Bar.ItemLinks>
</dxb:Bar>
</dxb:BarManager.Bars>
<dxb:BarManager.Items>
<dxb:BarButtonItem Command="{Binding Path=FileNew, Mode=OneTime, Source={StaticResource commands}}" CommandParameter="{Binding ElementName=richEditControl1}" Name="biFileNew" />
<dxb:BarButtonItem Command="{Binding Path=FileOpen, Mode=OneTime, Source={StaticResource commands}}" CommandParameter="{Binding ElementName=richEditControl1}" Name="biFileOpen" />
<dxb:BarButtonItem Command="{Binding Path=FileSave, Mode=OneTime, Source={StaticResource commands}}" CommandParameter="{Binding ElementName=richEditControl1}" Name="biFileSave" />
<dxb:BarButtonItem Command="{Binding Path=FileSaveAs, Mode=OneTime, Source={StaticResource commands}}" CommandParameter="{Binding ElementName=richEditControl1}" Name="biFileSaveAs" />
<!--Custom BarButtonItem-->
<dxb:BarButtonItem Command="{x:Static local:CustomRichEditUICommand.CustomCommand}" CommandParameter="{Binding ElementName=richEditControl1}" Name="biShowWordsCount" LargeGlyph="pack://application:,,,/Images/words.png" Content="Words Count" Hint="Shows the number of words in the document." />
</dxb:BarManager.Items>
<dxre:RichEditControl Name="richEditControl1" BarManager="{Binding ElementName=barManager1, Mode=OneTime}"
Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat." />
</dxb:BarManager>
</Grid>
</Window>