-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
39 lines (39 loc) · 1.89 KB
/
MainWindow.xaml
File metadata and controls
39 lines (39 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<mah:MetroWindow x:Class="TransitioningContentControlTest001.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:TransitioningContentControlTest001"
xmlns:vm="clr-namespace:TransitioningContentControlTest001.ViewModels"
xmlns:uc="clr-namespace:TransitioningContentControlTest001.UserControls"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.DataContext>
<vm:MainViewModel />
</Window.DataContext>
<Window.Resources>
<DataTemplate DataType="{x:Type vm:Content1ViewModel}">
<uc:Content1UserControl />
</DataTemplate>
<DataTemplate DataType="{x:Type vm:Content2ViewModel}">
<uc:Content2UserControl />
</DataTemplate>
<DataTemplate DataType="{x:Type vm:Content3ViewModel}">
<uc:Content2UserControl />
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<!--<ContentControl Content="{Binding Content}" />--> <!--For comparison.-->
<mah:TransitioningContentControl Content="{Binding Content}" />
<Button Grid.Row="1" Content="Content1" Command="{Binding LoadContent1Command}" />
<Button Grid.Row="2" Content="Content2" Command="{Binding LoadContent2Command}" />
<Button Grid.Row="3" Content="Content3" Command="{Binding LoadContent3Command}" />
</Grid>
</mah:MetroWindow>