O'Reilly logo

Windows Phone 7.5 Data Cookbook by Ramesh Thalli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Simple MVVM application

In this recipe, we will cover the basic principles of MVVM by creating a simple Phone 7 application with ViewModel and sample data.

Getting ready

Let's create a new Phone 7 Project with a project name Recipe1_SimpleMVVM and a solution name Ch8_Recipes.

How to do it...

Here we will create a simple user interface with a list box to display text in two TextBlock controls. Then, we will add the ViewModel class, which returns data from the sample data.

  1. Open MainPage.xaml and change the ApplicationTitle and PageTitle:
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> <TextBlock x:Name="ApplicationTitle" Text="Data Recipes" Style="{StaticResource PhoneTextNormalStyle}"/> <TextBlock x:Name="PageTitle" Text="Simple ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required