Skip to content

Instantly share code, notes, and snippets.

@kimsk
Last active December 26, 2015 20:29
Show Gist options
  • Save kimsk/7208903 to your computer and use it in GitHub Desktop.
Save kimsk/7208903 to your computer and use it in GitHub Desktop.
Design-Time WinRT XAML Binding
<Page
x:Class="DebugXamlBinding.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DebugXamlBinding"
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}"
d:DataContext="{d:DesignInstance Type=local:MainPageViewModelSample, IsDesignTimeCreatable=True}">
<TextBlock Text="{Binding Title}" FontSize="42" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
</Page>
public class MainPageViewModelSample
{
public MainPageViewModelSample()
{
Title = "Hello Design Time!";
}
public string Title { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment