|
<UserControl x:Class="OliverCode.MVVM.View.PersonView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="Auto" Width="Auto"
xmlns:local="clr-namespace:OliverCode.MVVM.ViewModel">
<StackPanel Orientation="Vertical" Margin="4">
<!--Here is where we the view gets a copy to the ViewModel Declaratively-->
<StackPanel.DataContext>
<local:PersonViewModel />
</StackPanel.DataContext>
<StackPanel Orientation="Vertical" DataContext="{Binding Path=Person, Mode=TwoWay}" Margin="4">
<StackPanel Orientation="Horizontal">
<Label Content="First Name:" Margin="0,0,4,0"/>
<TextBox Width="250" Text="{Binding Path=FirstName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<Label Content="Last Name:" Margin="0,0,4,0"/>
<TextBox Width="250" Text="{Binding Path=LastName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<Label Content="Age:" Margin="35,0,4,0"/>
<TextBox Width="50" MaxLength="3" Text="{Binding Path=Age}"/>
</StackPanel>
</StackPanel>
<StackPanel>
<Button Content="Save" HorizontalAlignment="Right" Width="80" Command="{Binding Path=SavePersonCommand}"/>
</StackPanel>
</StackPanel>
</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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.