-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainView.xaml
39 lines (39 loc) · 1.97 KB
/
MainView.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
<UserControl
x:Class="CompositeCommandBehaviorExample.View.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:vm="clr-namespace:CompositeCommandBehaviorExample.ViewModel"
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
<UserControl.DataContext>
<vm:MainViewModel/>
</UserControl.DataContext>
<dxmvvm:Interaction.Behaviors>
<dx:DXMessageBoxService />
</dxmvvm:Interaction.Behaviors>
<Grid>
<dxb:BarManager>
<dxb:BarManager.Bars>
<dxb:Bar Caption="Main Menu" IsMainMenu="True">
<dxb:BarButtonItem Content="Save" Command="{Binding SaveCommand}"/>
<dxb:BarButtonItem Content="Close" Command="{Binding CloseCommand}"/>
<dxb:BarButtonItem Content="Save and Close">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:CompositeCommandBehavior>
<dxmvvm:CommandItem Command="{Binding SaveCommand}"/>
<dxmvvm:CommandItem Command="{Binding CloseCommand}"/>
</dxmvvm:CompositeCommandBehavior>
</dxmvvm:Interaction.Behaviors>
</dxb:BarButtonItem>
</dxb:Bar>
</dxb:BarManager.Bars>
<Grid>
<TextBox Text="{Binding Text,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True"/>
</Grid>
</dxb:BarManager>
</Grid>
</UserControl>