comparison delete me/SilverlightValidation/Views/UserView.xaml @ 59:3591c26bd63e

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