-
Notifications
You must be signed in to change notification settings - Fork 6
/
MainWindow.xaml
64 lines (64 loc) · 4.43 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
<Window x:Class="EntityFrameworkIssues.MainWindow" 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:local="clr-namespace:EntityFrameworkIssues"
xmlns:local_issues="clr-namespace:EntityFrameworkIssues.Issues" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
mc:Ignorable="d" Title="MainWindow"
Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<dxb:ToolBarControl>
<dxb:BarButtonItem Content="Refresh (F5)" Command="{Binding View.Commands.RefreshDataSource, ElementName=grid}"
Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Refresh.svg}" BarItemDisplayMode="ContentAndGlyph" />
<dxb:BarButtonItem Content="Edit (F2)" Command="{Binding UpdateCommand, ElementName=EditFormBehavior}"
Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Edit.svg}" BarItemDisplayMode="ContentAndGlyph" />
<dxb:BarButtonItem Content="New" Command="{Binding CreateCommand, ElementName=EditFormBehavior}"
Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Add.svg}" BarItemDisplayMode="ContentAndGlyph" />
<dxb:BarButtonItem Content="Delete (Del)" Command="{Binding DeleteCommand, ElementName=EditFormBehavior}"
Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Delete.svg}" BarItemDisplayMode="ContentAndGlyph" />
</dxb:ToolBarControl>
<dxg:GridControl x:Name="grid" Grid.Row="1">
<dxg:GridControl.View>
<dxg:TableView ShowFixedTotalSummary="True" DataSourceRefresh="OnDataSourceRefresh"
RowDoubleClickCommand="{Binding RowDoubleClickCommand, ElementName=EditFormBehavior}" NavigationStyle="Row" />
</dxg:GridControl.View>
<dxg:GridColumn FieldName="Id" IsSmart="True"
ReadOnly="True" />
<dxg:GridColumn FieldName="Subject" IsSmart="True" />
<dxg:GridColumn FieldName="UserId" IsSmart="True"
Header="User">
<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings x:Name="usersLookup" DisplayMember="Name"
ValueMember="Id" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Created" IsSmart="True" />
<dxg:GridColumn FieldName="Votes" IsSmart="True" />
<dxg:GridColumn FieldName="Priority" IsSmart="True" />
<dxg:GridControl.TotalSummary>
<dxg:GridSummaryItem SummaryType="Count" Alignment="Right" />
</dxg:GridControl.TotalSummary>
<dxmvvm:Interaction.Behaviors>
<dxg:DialogEditFormBehavior x:Name="EditFormBehavior" KeyProperty="Id"
CreateEditItemViewModel="OnCreateEditEntityViewModel" ValidateRow="OnValidateRow"
ValidateRowDeletion="OnValidateRowDeletion">
<dxg:DialogEditFormBehavior.EditTemplate>
<DataTemplate>
<local:IssueDetailView />
</DataTemplate>
</dxg:DialogEditFormBehavior.EditTemplate>
</dxg:DialogEditFormBehavior>
</dxmvvm:Interaction.Behaviors>
<dxg:GridControl.InputBindings>
<KeyBinding Key="Delete" Command="{Binding DeleteCommand, ElementName=EditFormBehavior}" />
<KeyBinding Key="F2" Command="{Binding UpdateCommand, ElementName=EditFormBehavior}" />
<KeyBinding Key="N" Command="{Binding CreateCommand, ElementName=EditFormBehavior}"
Modifiers="Control" />
</dxg:GridControl.InputBindings>
</dxg:GridControl>
</Grid>
</Window>