<UserControl x:Class="MVVMSample.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:MVVMSample" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <!-- The datacontext for the usercontrol is an instance of our viewmodel. --> <UserControl.DataContext> <local:MainViewModel x:Name="viewModel" /> </UserControl.DataContext> <Grid x:Name="LayoutRoot" Background="White"> <StackPanel> <TextBlock Text="First Name" /> <TextBox Margin="4" Text="{Binding FirstName, Mode=TwoWay}" /> <TextBlock Text="Second Name" /> <TextBox Margin="4" Text="{Binding SecondName, Mode=TwoWay}" /> <Button Margin="4" Width="80" Content="Build Name" Command="{Binding BuildNameCommand}" /> <TextBox Margin="4" Text="{Binding FullName}" /> </StackPanel> </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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)