diff SilverlightGlimpse/SilverlightValidation/Views/UserView.xaml @ 69:a0bcd783e612

Latest work
author Steven Hollidge <stevenhollidge@hotmail.com>
date Mon, 23 Apr 2012 11:06:10 +0100
parents
children 86ed4919b126
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SilverlightGlimpse/SilverlightValidation/Views/UserView.xaml	Mon Apr 23 11:06:10 2012 +0100
@@ -0,0 +1,142 @@
+<c:ChildWindow x:Class="SilverlightValidation.Views.UserView"
+               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+               xmlns:c="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
+               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"
+               Title="Add User"
+               Width="500"
+               Height="400">
+
+    <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="120" />
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="30" />
+            <ColumnDefinition Width="100" />
+            <ColumnDefinition Width="300" />
+            <ColumnDefinition Width="30" />
+            <ColumnDefinition Width="30" />
+        </Grid.ColumnDefinitions>
+
+        <TextBlock Grid.Row="1"
+                   Grid.Column="1"
+                   Style="{StaticResource LabelStyle}"
+                   Text="Username:" />
+
+        <TextBox x:Name="tbUsername"
+                 Grid.Row="1"
+                 Grid.Column="2"
+                 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"
+                     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"
+                 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"
+                        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>
+</c:ChildWindow>
\ No newline at end of file