diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/delete me/SilverlightValidation/Views/UserView.xaml	Sat Apr 21 19:20:28 2012 +0100
@@ -0,0 +1,145 @@
+<UserControl x:Class="SilverlightValidation.Views.UserView"
+             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:p="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
+             xmlns:s="clr-namespace:System;assembly=mscorlib"
+             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
+             d:DesignHeight="400"
+             d:DesignWidth="450"
+             mc:Ignorable="d">
+
+    <Grid x:Name="LayoutRoot" Background="White">
+
+        <Grid.RowDefinitions>
+            <RowDefinition Height="30" />
+            <RowDefinition Height="30" />
+            <RowDefinition Height="30" />
+            <RowDefinition Height="30" />
+            <RowDefinition Height="30" />
+            <RowDefinition Height="30" />
+            <RowDefinition Height="50" />
+            <RowDefinition Height="150" />
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="100" />
+            <ColumnDefinition Width="300" />
+            <ColumnDefinition Width="30" />
+            <ColumnDefinition Width="*" />
+        </Grid.ColumnDefinitions>
+
+        <TextBlock Grid.Row="1"
+                   Grid.Column="1"
+                   Style="{StaticResource LabelStyle}"
+                   Text="Username:" />
+
+        <TextBox x:Name="tbUsername"
+                 Grid.Row="1"
+                 Grid.Column="2"
+                 LostFocus="tbUsername_LostFocus"
+                 Style="{StaticResource TextBoxStyle}"
+                 Text="{Binding Username,
+                                Mode=TwoWay,
+                                ValidatesOnNotifyDataErrors=True,
+                                NotifyOnValidationError=True}" />
+
+        <sdk:DescriptionViewer Grid.Row="1"
+                               Grid.Column="3"
+                               Width="20"
+                               Description="Required"
+                               Target="{Binding ElementName=tbUsername}" />
+
+        <TextBlock Grid.Row="2"
+                   Grid.Column="1"
+                   Style="{StaticResource LabelStyle}"
+                   Text="Password:" />
+
+        <PasswordBox x:Name="tbPassword"
+                     Grid.Row="2"
+                     Grid.Column="2"
+                     LostFocus="tbPassword_LostFocus"
+                     Password="{Binding Password,
+                                        Mode=TwoWay,
+                                        ValidatesOnNotifyDataErrors=True,
+                                        NotifyOnValidationError=True}"
+                     Style="{StaticResource PasswordBoxStyle}" />
+
+        <sdk:DescriptionViewer Grid.Row="2"
+                               Grid.Column="3"
+                               Width="20"
+                               Description="Required"
+                               Target="{Binding ElementName=tbPassword}" />
+
+        <TextBlock Grid.Row="3"
+                   Grid.Column="1"
+                   Style="{StaticResource LabelStyle}"
+                   Text="Email:" />
+
+        <TextBox x:Name="tbEmail"
+                 Grid.Row="3"
+                 Grid.Column="2"
+                 LostFocus="tbEmail_LostFocus"
+                 Style="{StaticResource TextBoxStyle}"
+                 Text="{Binding Email,
+                                Mode=TwoWay,
+                                ValidatesOnNotifyDataErrors=True,
+                                NotifyOnValidationError=True}" />
+
+        <sdk:DescriptionViewer Grid.Row="3"
+                               Grid.Column="3"
+                               Width="20"
+                               Description="Required"
+                               Target="{Binding ElementName=tbEmail}" />
+
+        <TextBlock Grid.Row="4"
+                   Grid.Column="1"
+                   Style="{StaticResource LabelStyle}"
+                   Text="Date of Birth:" />
+
+        <sdk:DatePicker x:Name="dpDateOfBirth"
+                        Grid.Row="4"
+                        Grid.Column="2"
+                        KeyDown="DatePicker_KeyDown"
+                        LostFocus="dpDateOfBirth_LostFocus"
+                        SelectedDate="{Binding DateOfBirth,
+                                               Mode=TwoWay,
+                                               ValidatesOnNotifyDataErrors=True,
+                                               NotifyOnValidationError=True}"
+                        Style="{StaticResource DatePickerStyle}" />
+        <sdk:DescriptionViewer Grid.Row="4"
+                               Grid.Column="3"
+                               Width="20"
+                               Description="Required"
+                               Target="{Binding ElementName=dpDateOfBirth}" />
+
+        <TextBlock x:Name="tbDescription"
+                   Grid.Row="5"
+                   Grid.Column="1"
+                   Style="{StaticResource LabelStyle}"
+                   Text="Description:" />
+
+        <TextBox Grid.Row="5"
+                 Grid.Column="2"
+                 Style="{StaticResource TextBoxStyle}"
+                 Text="{Binding Description}" />
+        <StackPanel Grid.Row="6"
+                    Grid.Column="2"
+                    HorizontalAlignment="Right"
+                    Orientation="Horizontal">
+            <Button Command="{Binding OkCommand}"
+                    Content="OK"
+                    Style="{StaticResource ButtonStyle}" />
+            <Button Command="{Binding CancelCommand}"
+                    Content="Cancel"
+                    Style="{StaticResource ButtonStyle}" />
+        </StackPanel>
+
+        <sdk:ValidationSummary Grid.Row="7"
+                               Grid.Column="1"
+                               Grid.ColumnSpan="2"
+                               Style="{StaticResource ValidationSummaryStyle}" />
+
+    </Grid>
+</UserControl>