69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 <UserControl x:Class="SilverlightValidation.Views.UserListView"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
4 xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
|
72
|
8 d:DesignHeight="500"
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 d:DesignWidth="725"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 mc:Ignorable="d">
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 <Grid x:Name="LayoutRoot">
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 <Grid.RowDefinitions>
|
72
|
14 <RowDefinition Height="30" />
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 <RowDefinition Height="40" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 <RowDefinition Height="300" />
|
72
|
17 <RowDefinition Height="30" />
|
|
18 <RowDefinition Height="100" />
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 </Grid.RowDefinitions>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 <Grid.ColumnDefinitions>
|
72
|
21 <ColumnDefinition Width="*" />
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 <ColumnDefinition Width="725" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 <ColumnDefinition Width="*" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24 </Grid.ColumnDefinitions>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 <StackPanel Grid.Row="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27 Grid.Column="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 HorizontalAlignment="Right"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
29 Orientation="Horizontal">
|
72
|
30 <Button x:Name="btnAdd"
|
|
31 Width="60"
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
32 Command="{Binding AddCommand}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
33 Content="Add"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
34 Style="{StaticResource ButtonStyle}" />
|
72
|
35 <Button x:Name="btnDelete"
|
|
36 Width="60"
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
37 Command="{Binding DeleteCommand}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
38 Content="Delete"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
39 Style="{StaticResource ButtonStyle}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
40 </StackPanel>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
41
|
72
|
42 <controls:DataGrid x:Name="dataGridUsers"
|
|
43 Grid.Row="2"
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
44 Grid.Column="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
45 AutoGenerateColumns="False"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
46 ItemsSource="{Binding Data}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
47 SelectedItem="{Binding SelectedItem,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
48 Mode=TwoWay}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
49 SelectionMode="Single">
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
50 <controls:DataGrid.Columns>
|
72
|
51 <controls:DataGridTextColumn x:Name="dgtcUsername"
|
|
52 Width="125"
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
53 Binding="{Binding Username,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
54 Mode=TwoWay,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
55 ValidatesOnNotifyDataErrors=True,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
56 NotifyOnValidationError=True}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
57 Header="Username" />
|
72
|
58 <controls:DataGridTemplateColumn x:Name="dgtcPassword"
|
|
59 Width="125"
|
|
60 Header="Password">
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
61 <sdk:DataGridTemplateColumn.CellTemplate>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
62 <DataTemplate>
|
72
|
63 <PasswordBox x:Name="pbPassword" Password="{Binding Password, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
64 </DataTemplate>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
65 </sdk:DataGridTemplateColumn.CellTemplate>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
66 </controls:DataGridTemplateColumn>
|
72
|
67 <controls:DataGridTextColumn x:Name="dgtcEmail"
|
|
68 Width="150"
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
69 Binding="{Binding Email,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
70 Mode=TwoWay,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
71 ValidatesOnNotifyDataErrors=True,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
72 NotifyOnValidationError=True}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
73 Header="Email" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
74
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
75 <controls:DataGridTemplateColumn Width="150" Header="Date of Birth">
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
76 <sdk:DataGridTemplateColumn.CellTemplate>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
77 <DataTemplate>
|
72
|
78 <sdk:DatePicker x:Name="dpDateOfBirth"
|
|
79 KeyDown="DatePicker_KeyDown"
|
|
80 SelectedDate="{Binding DateOfBirth,
|
|
81 Mode=TwoWay,
|
|
82 ValidatesOnNotifyDataErrors=True,
|
|
83 NotifyOnValidationError=True}" />
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
84 </DataTemplate>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
85 </sdk:DataGridTemplateColumn.CellTemplate>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
86 </controls:DataGridTemplateColumn>
|
72
|
87 <controls:DataGridTextColumn x:Name="dgtcDescription"
|
|
88 Width="150"
|
71
|
89 Binding="{Binding INCORRECTPATH,
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
90 Mode=TwoWay,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
91 ValidatesOnNotifyDataErrors=True,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
92 NotifyOnValidationError=True}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
93 Header="Description" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
94 </controls:DataGrid.Columns>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
95 </controls:DataGrid>
|
72
|
96
|
|
97 <Button x:Name="btnThrowException"
|
|
98 Grid.Row="4"
|
|
99 Grid.Column="1"
|
|
100 Width="150"
|
|
101 Height="50"
|
|
102 HorizontalAlignment="Center"
|
|
103 Content="Throw Exception"
|
|
104 Click="btnThrowException_Click"/>
|
69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
105 </Grid>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
106 </UserControl>
|