namespace PrismForWinRTDemo
{
sealed partial class App : MvvmAppBase
}
<prism:MvvmAppBase
x:Class="PrismForWinRTDemo.App"
xmlns:prism="using:Microsoft.Practices.Prism.Mvvm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:PrismForWinRTDemo">
</prism:MvvmAppBase>
public App()
this.InitializeComponent();
protected override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args)
return Task.FromResult<object>(null);
namespace PrismForWinRTDemo.Views
public sealed partial class MainPage : VisualStateAwarePage
public MainPage()
<storeapp:VisualStateAwarePage
x:Class="PrismForWinRTDemo.Views.MainPage"
xmlns:storeapp="using:Microsoft.Practices.Prism.StoreApps"
xmlns:local="using:PrismForWinRTDemo"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
</Grid>
</storeapp:VisualStateAwarePage>
namespace PrismForWinRTDemo.Interfaces
public interface IMainPageViewModel
string FirstName { get; set; }
string LastName { get; set; }
namespace PrismForWinRTDemo.ViewModels
public class MainPageViewModel : ViewModel, IMainPageViewModel
private string firstName;
public string FirstName
get
return firstName;
set
SetProperty(ref firstName, value);
private string lastName;
public string LastName
return lastName;
SetProperty(ref lastName, value);
public override void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
this.FirstName = "Jaliya";
this.LastName = "Udagedara";
prism:ViewModelLocator.AutoWireViewModel="True"
<StackPanel>
<TextBlock Text="{Binding }"></TextBlock>
<TextBlock></TextBlock>
</StackPanel>
namespace PrismForWinRTDemo.DesignTime
public class MainPageViewModel : IMainPageViewModel
public string FirstName { get; set; }
public string LastName { get; set; }
public MainPageViewModel()
this.FirstName = "Design time first name";
this.LastName = "Design time last name";
xmlns:designtime="using:PrismForWinRTDemo.DesignTime"
<d:Page.DataContext>
<designtime:MainPageViewModel />
</d:Page.DataContext>
<TextBlock Text="{Binding FirstName}" Style="{StaticResource HeaderTextBlockStyle}"></TextBlock>
<TextBlock Text="{Binding LastName}" Style="{StaticResource SubheaderTextBlockStyle}"></TextBlock>
this.NavigationService.Navigate("Main", null);
Congratulations on the guru award.
Great article.