|
<UserControl x:Class="UpdateSourceTrigger.MainPage"
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:UpdateSourceTrigger"
mc:Ignorable="d"
>
<UserControl.DataContext>
<local:PersonViewModel/>
</UserControl.DataContext>
<Grid x:Name="LayoutRoot" Background="White" Width="400" Height="300" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Text="First Name :" Grid.Column="0" Grid.Row="0"/>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Text="Middle Name :" Grid.Column="0" Grid.Row="1"/>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Text="Last Name :" Grid.Column="0" Grid.Row="2"/>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Text="Monthly Salary :" Grid.Column="0" Grid.Row="3"/>
<TextBox Text="{Binding Context.FirstName, Mode=TwoWay}" Grid.Column="1" Grid.Row="0" Margin="5" local:UpdateSourceManager.UpdateOnPropertyChanged="True"/>
<TextBox Text="{Binding Context.MiddleName, Mode=TwoWay}" Grid.Column="1" Grid.Row="1" Margin="5" local:UpdateSourceManager.UpdateOnPropertyChanged="True"/>
<TextBox Text="{Binding Context.LastName, Mode=TwoWay}" Grid.Column="1" Grid.Row="2" Margin="5" local:UpdateSourceManager.UpdateOnPropertyChanged="True"/>
<TextBox Text="{Binding Context.Salary, Mode=TwoWay}" Grid.Column="1" Grid.Row="3" Margin="5" local:UpdateSourceManager.UpdateOnPropertyChanged="True"/>
</Grid>
<Button Content="Save Context..." Margin="5" Grid.Row="1" HorizontalAlignment="Right" Width="125" Command="{Binding SaveContext}"/>
</Grid>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.