|
|
|
|
<Window x:Class="DataBindByINotifyPropertyChangedSample.MainWindow"
|
|
|
|
|
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:DataBindByINotifyPropertyChangedSample"
|
|
|
|
|
xmlns:vm="clr-namespace:DataBindByINotifyPropertyChangedSample.ViewModel"
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
Title="MainWindow" Height="250" Width="450">
|
|
|
|
|
<Window.DataContext>
|
|
|
|
|
<vm:UserViewModel/>
|
|
|
|
|
</Window.DataContext>
|
|
|
|
|
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
<TextBlock Grid.Column="0" Grid.Row="0" Margin="5"
|
|
|
|
|
Text="First name: "/>
|
|
|
|
|
<TextBox x:Name="tbxFirstName"
|
|
|
|
|
Grid.Column="1" Grid.Row="0" Margin="5" Width="300"
|
|
|
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
|
|
Text="{Binding FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
|
|
|
|
|
|
|
|
|
<TextBlock Grid.Column="0" Grid.Row="1" Margin="5"
|
|
|
|
|
Text="Last name: "/>
|
|
|
|
|
<TextBox x:Name="tbxLastName"
|
|
|
|
|
Grid.Column="1" Grid.Row="1" Margin="5" Width="300"
|
|
|
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
|
|
Text="{Binding LastName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
|
|
|
|
|
|
|
|
|
<Grid Grid.Column="1" Grid.Row="2">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
<Button x:Name="btnShow"
|
|
|
|
|
Grid.Column="0" Grid.Row="0" Margin="3"
|
|
|
|
|
Content="Show"
|
|
|
|
|
Click="btnShow_Click"/>
|
|
|
|
|
<Button x:Name="btnChange"
|
|
|
|
|
Grid.Column="1" Grid.Row="0" Margin="3"
|
|
|
|
|
Content="Change"
|
|
|
|
|
Click="btnChange_Click"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|