comparison SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml @ 69:a0bcd783e612

Latest work
author Steven Hollidge <stevenhollidge@hotmail.com>
date Mon, 23 Apr 2012 11:06:10 +0100
parents
children 96e6fbd70f49
comparison
equal deleted inserted replaced
68:81337ebf885a 69:a0bcd783e612
1 <UserControl x:Class="SilverlightValidation.Views.UserListView"
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
5 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
8 d:DesignHeight="400"
9 d:DesignWidth="725"
10 mc:Ignorable="d">
11
12 <Grid x:Name="LayoutRoot">
13 <Grid.RowDefinitions>
14 <RowDefinition Height="auto" />
15 <RowDefinition Height="40" />
16 <RowDefinition Height="300" />
17 </Grid.RowDefinitions>
18 <Grid.ColumnDefinitions>
19 <ColumnDefinition Width="auto" />
20 <ColumnDefinition Width="725" />
21 <ColumnDefinition Width="*" />
22 </Grid.ColumnDefinitions>
23
24 <StackPanel Grid.Row="1"
25 Grid.Column="1"
26 HorizontalAlignment="Right"
27 Orientation="Horizontal">
28 <Button Width="60"
29 Command="{Binding AddCommand}"
30 Content="Add"
31 Style="{StaticResource ButtonStyle}" />
32 <Button Width="60"
33 Command="{Binding DeleteCommand}"
34 Content="Delete"
35 Style="{StaticResource ButtonStyle}" />
36 </StackPanel>
37
38 <controls:DataGrid Grid.Row="2"
39 Grid.Column="1"
40 AutoGenerateColumns="False"
41 ItemsSource="{Binding Data}"
42 SelectedItem="{Binding SelectedItem,
43 Mode=TwoWay}"
44 SelectionMode="Single">
45 <controls:DataGrid.Columns>
46 <controls:DataGridTextColumn Width="125"
47 Binding="{Binding Username,
48 Mode=TwoWay,
49 ValidatesOnNotifyDataErrors=True,
50 NotifyOnValidationError=True}"
51 Header="Username" />
52 <controls:DataGridTemplateColumn Width="125" Header="Password">
53 <sdk:DataGridTemplateColumn.CellTemplate>
54 <DataTemplate>
55 <PasswordBox Password="{Binding Password, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
56 </DataTemplate>
57 </sdk:DataGridTemplateColumn.CellTemplate>
58 </controls:DataGridTemplateColumn>
59 <controls:DataGridTextColumn Width="150"
60 Binding="{Binding Email,
61 Mode=TwoWay,
62 ValidatesOnNotifyDataErrors=True,
63 NotifyOnValidationError=True}"
64 Header="Email" />
65
66 <controls:DataGridTemplateColumn Width="150" Header="Date of Birth">
67 <sdk:DataGridTemplateColumn.CellTemplate>
68 <DataTemplate>
69 <sdk:DatePicker KeyDown="DatePicker_KeyDown" SelectedDate="{Binding DateOfBirth, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
70 </DataTemplate>
71 </sdk:DataGridTemplateColumn.CellTemplate>
72 </controls:DataGridTemplateColumn>
73 <controls:DataGridTextColumn Width="150"
74 Binding="{Binding Description,
75 Mode=TwoWay,
76 ValidatesOnNotifyDataErrors=True,
77 NotifyOnValidationError=True}"
78 Header="Description" />
79 </controls:DataGrid.Columns>
80 </controls:DataGrid>
81 </Grid>
82 </UserControl>