/
MainWindow.xaml
44 lines (40 loc) · 1.66 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
<Window
x:Class="E2042.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:local="clr-namespace:E2042"
Title="MainWindow"
Width="600"
Height="350">
<Window.Resources>
<Style TargetType="dxg:GridColumn">
<Setter Property="Width" Value="Auto"/>
</Style>
</Window.Resources>
<Window.DataContext>
<local:ViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<dxg:GridControl AutoGenerateColumns="AddNew" ItemsSource="{Binding List}"/>
<StackPanel Grid.Row="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<StackPanel.Resources>
<Style TargetType="Button">
<Setter Property="Width" Value="140"/>
<Setter Property="Margin" Value="5,0"/>
</Style>
</StackPanel.Resources>
<Button Command="{Binding ChangeSourceCommand}" Content="Reset items"/>
<Button Command="{Binding ChangeItemCommand}" Content="Change the first item"/>
<Button Command="{Binding AddNewItemCommand}" Content="Add a new item"/>
<Button Command="{Binding DeleteItemCommand}" Content="Delete the last item"/>
</StackPanel>
</Grid>
</Window>