Created
April 10, 2012 15:52
-
-
Save timheuer/2352351 to your computer and use it in GitHub Desktop.
dynamic type binding Metro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Page | |
x:Class="Application141.BlankPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:Application141" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d"> | |
<Grid Background="{StaticResource ApplicationPageBackgroundBrush}"> | |
<StackPanel> | |
<TextBlock Text="{Binding FirstName}" /> | |
<TextBlock Text="{Binding LastName}" /> | |
</StackPanel> | |
</Grid> | |
</Page> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
namespace Application141 | |
{ | |
public sealed partial class BlankPage : Page | |
{ | |
public BlankPage() | |
{ | |
this.InitializeComponent(); | |
Loaded += BlankPage_Loaded; | |
} | |
void BlankPage_Loaded(object sender, RoutedEventArgs e) | |
{ | |
dynamic foo = new | |
{ | |
FirstName = "Tim", | |
LastName = "Heuer" | |
}; | |
this.DataContext = foo; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment