address book using mvvm
This commit is contained in:
65
PacticeSolution/AddressBook_MVVMSampleV2/View/AddView.xaml
Normal file
65
PacticeSolution/AddressBook_MVVMSampleV2/View/AddView.xaml
Normal file
@@ -0,0 +1,65 @@
|
||||
<Window x:Name="winAddView"
|
||||
x:Class="AddressBook_MVVMSampleV2.View.AddView"
|
||||
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_MVVMSampleV2.View"
|
||||
xmlns:vm="clr-namespace:AddressBook_MVVMSampleV2.ViewModel"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance vm:AddViewModel}"
|
||||
Title="{Binding Caption, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowStyle="ToolWindow"
|
||||
Height="300" Width="300">
|
||||
<Grid Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="60"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="30"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Margin="3"
|
||||
Content="Name"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="3"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding PersonData.Name, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Margin="3"
|
||||
Content="Gender"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Margin="3"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding PersonData.Gender, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" Margin="3"
|
||||
Content="Phone"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Margin="3"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding PersonData.PhoneNumber, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Margin="3"
|
||||
Content="Address"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Margin="3"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding PersonData.Address, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
||||
|
||||
<StackPanel Grid.Column="1" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right" Margin="3">
|
||||
<Button Width="70" Margin="3 0 0 0"
|
||||
Content="OK"
|
||||
IsDefault="True"
|
||||
Command="{Binding OkCommand}"
|
||||
CommandParameter="{Binding ElementName=winAddView}"/>
|
||||
<Button Width="70" Margin="3 0 0 0"
|
||||
Content="Cancel"
|
||||
IsDefault="True"
|
||||
Command="{Binding CancelCommand}"
|
||||
CommandParameter="{Binding ElementName=winAddView}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
Reference in New Issue
Block a user