comparison delete me/SilverlightValidation/Views/UserListView.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.UserListView"
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
5 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7 xmlns:p="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
8 xmlns:s="clr-namespace:System;assembly=mscorlib"
9 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
10 d:DesignHeight="400"
11 d:DesignWidth="725"
12 mc:Ignorable="d">
13
14 <Grid x:Name="LayoutRoot" Background="White">
15 <Grid.RowDefinitions>
16 <RowDefinition Height="30" />
17 <RowDefinition Height="40" />
18 <RowDefinition Height="300" />
19 <RowDefinition Height="50" />
20 </Grid.RowDefinitions>
21 <Grid.ColumnDefinitions>
22 <ColumnDefinition Width="*" />
23 <ColumnDefinition Width="725" />
24 <ColumnDefinition Width="*" />
25 </Grid.ColumnDefinitions>
26
27 <StackPanel Grid.Row="1"
28 Grid.Column="1"
29 HorizontalAlignment="Right"
30 Orientation="Horizontal">
31 <Button Width="60"
32 Command="{Binding AddCommand}"
33 Content="Add"
34 Style="{StaticResource ButtonStyle}" />
35 <Button Width="60"
36 Command="{Binding CancelCommand}"
37 Content="Delete"
38 Style="{StaticResource ButtonStyle}" />
39 </StackPanel>
40
41 <controls:DataGrid Grid.Row="2"
42 Grid.Column="1"
43 AutoGenerateColumns="False"
44 ItemsSource="{Binding Data}"
45 SelectedItem="{Binding SelectedItem}">
46 <controls:DataGrid.Columns>
47 <controls:DataGridTextColumn Width="125"
48 Binding="{Binding Username,
49 Mode=TwoWay,
50 ValidatesOnNotifyDataErrors=True,
51 NotifyOnValidationError=True}"
52 Header="Username" />
53 <controls:DataGridTemplateColumn Width="125" Header="Password">
54 <sdk:DataGridTemplateColumn.CellTemplate>
55 <DataTemplate>
56 <PasswordBox Password="{Binding Password, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
57 </DataTemplate>
58 </sdk:DataGridTemplateColumn.CellTemplate>
59 </controls:DataGridTemplateColumn>
60 <controls:DataGridTextColumn Width="150"
61 Binding="{Binding Email,
62 Mode=TwoWay,
63 ValidatesOnNotifyDataErrors=True,
64 NotifyOnValidationError=True}"
65 Header="Email" />
66
67 <controls:DataGridTemplateColumn Width="150" Header="Date of Birth">
68 <sdk:DataGridTemplateColumn.CellTemplate>
69 <DataTemplate>
70 <sdk:DatePicker KeyDown="DatePicker_KeyDown" SelectedDate="{Binding DateOfBirth, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
71 </DataTemplate>
72 </sdk:DataGridTemplateColumn.CellTemplate>
73 </controls:DataGridTemplateColumn>
74 <controls:DataGridTextColumn Width="150"
75 Binding="{Binding XXXDescription,
76 Mode=TwoWay,
77 ValidatesOnNotifyDataErrors=True,
78 NotifyOnValidationError=True}"
79 Header="Description" />
80 </controls:DataGrid.Columns>
81 </controls:DataGrid>
82 </Grid>
83 </UserControl>