-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
78 lines (69 loc) · 3.1 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<dx:ThemedWindow x:Class="DXSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:ViewModels="clr-namespace:DXSample.ViewModels"
xmlns:Common="clr-namespace:DXSample.Common"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
Title="MainWindow" Height="350" Width="525">
<dx:ThemedWindow.DataContext>
<ViewModels:MainViewModel/>
</dx:ThemedWindow.DataContext>
<dxmvvm:Interaction.Behaviors>
<dx:DXMessageBoxService/>
</dxmvvm:Interaction.Behaviors>
<dx:ThemedWindow.Resources>
<DataTemplate DataType="{x:Type ViewModels:BarItemViewModel}">
<ContentControl>
<dxb:BarButtonItem
Content="{Binding Caption}"
Glyph="{Binding Glyph}"
GlyphAlignment="Top"
BarItemDisplayMode="ContentAndGlyph"
Command="{Binding ExecuteActionCommand}"
CommandParameter="{Binding Caption}"/>
</ContentControl>
</DataTemplate>
<DataTemplate DataType="{x:Type ViewModels:GroupBarItemViewModel}">
<ContentControl>
<dxb:BarSubItem
Content="{Binding Caption}"
Glyph="{Binding Glyph}"
GlyphAlignment="Left"
BarItemDisplayMode="ContentAndGlyph"
ItemLinksSource="{Binding SubItems}"/>
</ContentControl>
</DataTemplate>
<DataTemplate DataType="{x:Type ViewModels:BarItemViewModelBase}">
<ContentControl>
<dxb:BarItemSeparator />
</ContentControl>
</DataTemplate>
<DataTemplate DataType="{x:Type ViewModels:StaticBarItemViewModel}">
<ContentControl>
<dxb:BarStaticItem Content="{Binding Caption}"/>
</ContentControl>
</DataTemplate>
<DataTemplate x:Key="mainMenuTemplate">
<ContentControl>
<dxb:Bar Caption="{Binding Name}" ItemLinksSource="{Binding Items}" IsMainMenu="True"/>
</ContentControl>
</DataTemplate>
<DataTemplate x:Key="statusBarTemplate">
<ContentControl>
<dxb:Bar Caption="{Binding Name}" ItemLinksSource="{Binding Items}" IsStatusBar="True">
<dxb:Bar.DockInfo>
<dxb:BarDockInfo ContainerType="Bottom"/>
</dxb:Bar.DockInfo>
</dxb:Bar>
</ContentControl>
</DataTemplate>
<Common:BarTemplateSelector x:Key="BarTemplateSelector"
MainMenuTemplate="{StaticResource mainMenuTemplate}"
StatusBarTemplate="{StaticResource statusBarTemplate}"/>
</dx:ThemedWindow.Resources>
<Grid>
<dxb:BarManager BarsSource="{Binding Bars}" BarTemplateSelector="{StaticResource BarTemplateSelector}"/>
</Grid>
</dx:ThemedWindow>