Database Reference
In-Depth Information
private static TechBioModel viewModel = null;
public static TechBioModel ViewModel
{
get
{
if (viewModel == null)
viewModel = new TechBioModel();
return viewModel;
}
}
Right-click MainPage.xaml in Solution Explorer, and select View Code. Add the
following code below the MainPage constructor:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
11.
if (DataContext == null)
DataContext = App.ViewModel;
}
Set the ItemSource property of the list box on the phone UI as shown in Figure
7-17. This binds the list box to the Docs DataServiceCollection so that when
the collection is populated, the list box displays the data.
12.
Figure 7-17. Setting the ItemSource property
Search WWH ::




Custom Search