-
Notifications
You must be signed in to change notification settings - Fork 6
/
MainWindow.xaml
42 lines (42 loc) · 3.02 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="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:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
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 View.Commands.EditFocusedRow, ElementName=grid}"
Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Edit.svg}" BarItemDisplayMode="ContentAndGlyph" />
<dxb:BarButtonItem Content="New" Command="{Binding View.Commands.AddNewRow, ElementName=grid}"
Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Add.svg}" BarItemDisplayMode="ContentAndGlyph" />
<dxb:BarButtonItem Content="Delete (Del)" Command="{Binding View.Commands.DeleteFocusedRow, ElementName=grid}"
Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Delete.svg}" BarItemDisplayMode="ContentAndGlyph" />
</dxb:ToolBarControl>
<dxg:GridControl x:Name="grid" Grid.Row="1"
RestoreStateKeyFieldName="Id" RestoreStateOnSourceChange="True">
<dxg:GridControl.View>
<dxg:TableView NewItemRowPosition="Top" ShowUpdateRowButtons="OnCellEditorOpen"
ValidateRow="OnValidateRow" ValidateRowDeletion="OnValidateRowDeletion"
DataSourceRefresh="OnDataSourceRefresh" ShowFixedTotalSummary="True" />
</dxg:GridControl.View>
<dxg:GridColumn FieldName="Id" IsSmart="True"
ReadOnly="True" />
<dxg:GridColumn FieldName="FirstName" IsSmart="True" />
<dxg:GridColumn FieldName="LastName" IsSmart="True" />
<dxg:GridControl.InputBindings>
<KeyBinding Key="Delete" Command="{Binding View.Commands.DeleteFocusedRow, ElementName=grid}" />
</dxg:GridControl.InputBindings>
<dxg:GridControl.TotalSummary>
<dxg:GridSummaryItem SummaryType="Count" Alignment="Right" />
</dxg:GridControl.TotalSummary>
</dxg:GridControl>
</Grid>
</Window>