Created
August 22, 2011 23:28
-
-
Save alexdioso/1163915 to your computer and use it in GitHub Desktop.
Run-time and design-time selection of a ViewModel using only xaml.
This file contains 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
<Window Name="mMainView" | |
x:Class="MyProject.MainView" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:vm="clr-namespace:MyProject.ViewModels" | |
mc:Ignorable="d" | |
Title="My Project" Height="450" Width="800"> | |
<mc:AlternateContent> | |
<mc:Choice Requires="d"> | |
<Window.Resources> | |
<vm:MockViewModel x:Key="MainViewModel" /> | |
</Window.Resources> | |
</mc:Choice> | |
<mc:Fallback> | |
<Window.Resources> | |
<vm:MainViewModel x:Key="MainViewModel" /> | |
</Window.Resources> | |
</mc:Fallback> | |
</mc:AlternateContent> | |
<Grid HorizontalAlignment="Stretch" | |
VerticalAlignment="Stretch" | |
DataContext="{StaticResource MainViewModel}"> | |
</Grid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment