59
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 <UserControl x:Class="SilverlightValidation.Views.UserView"
|
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:d="http://schemas.microsoft.com/expression/blend/2008"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 xmlns:p="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 xmlns:s="clr-namespace:System;assembly=mscorlib"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 d:DesignHeight="400"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 d:DesignWidth="450"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 mc:Ignorable="d">
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 <Grid x:Name="LayoutRoot" Background="White">
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 <Grid.RowDefinitions>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 <RowDefinition Height="30" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17 <RowDefinition Height="30" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18 <RowDefinition Height="30" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 <RowDefinition Height="30" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 <RowDefinition Height="30" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21 <RowDefinition Height="30" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 <RowDefinition Height="50" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 <RowDefinition Height="150" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24 </Grid.RowDefinitions>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25 <Grid.ColumnDefinitions>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 <ColumnDefinition Width="*" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27 <ColumnDefinition Width="100" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 <ColumnDefinition Width="300" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
29 <ColumnDefinition Width="30" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
30 <ColumnDefinition Width="*" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
31 </Grid.ColumnDefinitions>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
32
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
33 <TextBlock Grid.Row="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
34 Grid.Column="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
35 Style="{StaticResource LabelStyle}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
36 Text="Username:" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
37
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
38 <TextBox x:Name="tbUsername"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
39 Grid.Row="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
40 Grid.Column="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
41 LostFocus="tbUsername_LostFocus"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
42 Style="{StaticResource TextBoxStyle}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
43 Text="{Binding Username,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
44 Mode=TwoWay,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
45 ValidatesOnNotifyDataErrors=True,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
46 NotifyOnValidationError=True}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
47
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
48 <sdk:DescriptionViewer Grid.Row="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
49 Grid.Column="3"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
50 Width="20"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
51 Description="Required"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
52 Target="{Binding ElementName=tbUsername}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
53
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
54 <TextBlock Grid.Row="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
55 Grid.Column="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
56 Style="{StaticResource LabelStyle}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
57 Text="Password:" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
58
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
59 <PasswordBox x:Name="tbPassword"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
60 Grid.Row="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
61 Grid.Column="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
62 LostFocus="tbPassword_LostFocus"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
63 Password="{Binding Password,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
64 Mode=TwoWay,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
65 ValidatesOnNotifyDataErrors=True,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
66 NotifyOnValidationError=True}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
67 Style="{StaticResource PasswordBoxStyle}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
68
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
69 <sdk:DescriptionViewer Grid.Row="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
70 Grid.Column="3"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
71 Width="20"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
72 Description="Required"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
73 Target="{Binding ElementName=tbPassword}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
74
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
75 <TextBlock Grid.Row="3"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
76 Grid.Column="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
77 Style="{StaticResource LabelStyle}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
78 Text="Email:" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
79
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
80 <TextBox x:Name="tbEmail"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
81 Grid.Row="3"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
82 Grid.Column="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
83 LostFocus="tbEmail_LostFocus"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
84 Style="{StaticResource TextBoxStyle}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
85 Text="{Binding Email,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
86 Mode=TwoWay,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
87 ValidatesOnNotifyDataErrors=True,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
88 NotifyOnValidationError=True}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
89
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
90 <sdk:DescriptionViewer Grid.Row="3"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
91 Grid.Column="3"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
92 Width="20"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
93 Description="Required"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
94 Target="{Binding ElementName=tbEmail}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
95
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
96 <TextBlock Grid.Row="4"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
97 Grid.Column="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
98 Style="{StaticResource LabelStyle}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
99 Text="Date of Birth:" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
100
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
101 <sdk:DatePicker x:Name="dpDateOfBirth"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
102 Grid.Row="4"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
103 Grid.Column="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
104 KeyDown="DatePicker_KeyDown"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
105 LostFocus="dpDateOfBirth_LostFocus"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
106 SelectedDate="{Binding DateOfBirth,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
107 Mode=TwoWay,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
108 ValidatesOnNotifyDataErrors=True,
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
109 NotifyOnValidationError=True}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
110 Style="{StaticResource DatePickerStyle}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
111 <sdk:DescriptionViewer Grid.Row="4"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
112 Grid.Column="3"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
113 Width="20"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
114 Description="Required"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
115 Target="{Binding ElementName=dpDateOfBirth}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
116
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
117 <TextBlock x:Name="tbDescription"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
118 Grid.Row="5"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
119 Grid.Column="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
120 Style="{StaticResource LabelStyle}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
121 Text="Description:" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
122
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
123 <TextBox Grid.Row="5"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
124 Grid.Column="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
125 Style="{StaticResource TextBoxStyle}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
126 Text="{Binding Description}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
127 <StackPanel Grid.Row="6"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
128 Grid.Column="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
129 HorizontalAlignment="Right"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
130 Orientation="Horizontal">
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
131 <Button Command="{Binding OkCommand}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
132 Content="OK"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
133 Style="{StaticResource ButtonStyle}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
134 <Button Command="{Binding CancelCommand}"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
135 Content="Cancel"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
136 Style="{StaticResource ButtonStyle}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
137 </StackPanel>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
138
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
139 <sdk:ValidationSummary Grid.Row="7"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
140 Grid.Column="1"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
141 Grid.ColumnSpan="2"
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
142 Style="{StaticResource ValidationSummaryStyle}" />
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
143
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
144 </Grid>
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
145 </UserControl>
|