diff SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml @ 72:177a9d1eba10

Latest version
author Steven Hollidge <stevenhollidge@hotmail.com>
date Mon, 23 Apr 2012 17:57:21 +0100
parents 96e6fbd70f49
children 86ed4919b126
line wrap: on
line diff
--- a/SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml	Mon Apr 23 14:54:24 2012 +0100
+++ b/SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml	Mon Apr 23 17:57:21 2012 +0100
@@ -5,18 +5,20 @@
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
-             d:DesignHeight="400"
+             d:DesignHeight="500"
              d:DesignWidth="725"
              mc:Ignorable="d">
 
     <Grid x:Name="LayoutRoot">
         <Grid.RowDefinitions>
-            <RowDefinition Height="auto" />
+            <RowDefinition Height="30" />
             <RowDefinition Height="40" />
             <RowDefinition Height="300" />
+            <RowDefinition Height="30" />
+            <RowDefinition Height="100" />
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="*" />
             <ColumnDefinition Width="725" />
             <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>
@@ -25,17 +27,20 @@
                     Grid.Column="1"
                     HorizontalAlignment="Right"
                     Orientation="Horizontal">
-            <Button Width="60"
+            <Button x:Name="btnAdd"
+                    Width="60"
                     Command="{Binding AddCommand}"
                     Content="Add"
                     Style="{StaticResource ButtonStyle}" />
-            <Button Width="60"
+            <Button x:Name="btnDelete"
+                    Width="60"
                     Command="{Binding DeleteCommand}"
                     Content="Delete"
                     Style="{StaticResource ButtonStyle}" />
         </StackPanel>
 
-        <controls:DataGrid Grid.Row="2"
+        <controls:DataGrid x:Name="dataGridUsers"
+                           Grid.Row="2"
                            Grid.Column="1"
                            AutoGenerateColumns="False"
                            ItemsSource="{Binding Data}"
@@ -43,20 +48,24 @@
                                                   Mode=TwoWay}"
                            SelectionMode="Single">
             <controls:DataGrid.Columns>
-                <controls:DataGridTextColumn Width="125"
+                <controls:DataGridTextColumn x:Name="dgtcUsername"
+                                             Width="125"
                                              Binding="{Binding Username,
                                                                Mode=TwoWay,
                                                                ValidatesOnNotifyDataErrors=True,
                                                                NotifyOnValidationError=True}"
                                              Header="Username" />
-                <controls:DataGridTemplateColumn Width="125" Header="Password">
+                <controls:DataGridTemplateColumn x:Name="dgtcPassword"
+                                                 Width="125"
+                                                 Header="Password">
                     <sdk:DataGridTemplateColumn.CellTemplate>
                         <DataTemplate>
-                            <PasswordBox Password="{Binding Password, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
+                            <PasswordBox x:Name="pbPassword" Password="{Binding Password, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
                         </DataTemplate>
                     </sdk:DataGridTemplateColumn.CellTemplate>
                 </controls:DataGridTemplateColumn>
-                <controls:DataGridTextColumn Width="150"
+                <controls:DataGridTextColumn x:Name="dgtcEmail"
+                                             Width="150"
                                              Binding="{Binding Email,
                                                                Mode=TwoWay,
                                                                ValidatesOnNotifyDataErrors=True,
@@ -66,11 +75,17 @@
                 <controls:DataGridTemplateColumn Width="150" Header="Date of Birth">
                     <sdk:DataGridTemplateColumn.CellTemplate>
                         <DataTemplate>
-                            <sdk:DatePicker KeyDown="DatePicker_KeyDown" SelectedDate="{Binding DateOfBirth, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
+                            <sdk:DatePicker x:Name="dpDateOfBirth"
+                                            KeyDown="DatePicker_KeyDown"
+                                            SelectedDate="{Binding DateOfBirth,
+                                                                   Mode=TwoWay,
+                                                                   ValidatesOnNotifyDataErrors=True,
+                                                                   NotifyOnValidationError=True}" />
                         </DataTemplate>
                     </sdk:DataGridTemplateColumn.CellTemplate>
                 </controls:DataGridTemplateColumn>
-                <controls:DataGridTextColumn Width="150"
+                <controls:DataGridTextColumn x:Name="dgtcDescription"
+                                             Width="150"
                                              Binding="{Binding INCORRECTPATH,
                                                                Mode=TwoWay,
                                                                ValidatesOnNotifyDataErrors=True,
@@ -78,5 +93,14 @@
                                              Header="Description" />
             </controls:DataGrid.Columns>
         </controls:DataGrid>
+
+        <Button x:Name="btnThrowException"
+                Grid.Row="4"
+                Grid.Column="1"
+                Width="150"
+                Height="50"
+                HorizontalAlignment="Center"
+                Content="Throw Exception"
+                Click="btnThrowException_Click"/>
     </Grid>
 </UserControl>