address book by mvvm pattern
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<Window x:Class="AddressBook_MVVMSample.SubWindow.AddViewWindow"
|
||||
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:local="clr-namespace:AddressBook_MVVMSample.SubWindow"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance local:AddViewWindow}"
|
||||
Title="{Binding Caption, UpdateSourceTrigger=PropertyChanged}" Height="300" Width="300"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<!--<Window.DataContext>
|
||||
<local:AddViewWindow/>
|
||||
</Window.DataContext>-->
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Content="Name"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Width="200" Margin="3"
|
||||
Text="{Binding PersonData.Name, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Content="Gender"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Width="200" Margin="3"
|
||||
Text="{Binding PersonData.Gender, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Content="Phone"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Width="200" Margin="3"
|
||||
Text="{Binding PersonData.PhoneNumber, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Content="Address"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Width="200" Height="150" Margin="3"
|
||||
Text="{Binding PersonData.Address, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Grid.Column="0" Margin="5"
|
||||
Content="OK"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<Button Grid.Column="1" Margin="5"
|
||||
Content="Cancel"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
Reference in New Issue
Block a user