-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
44 lines (39 loc) · 1.66 KB
/
Copy pathMainWindow.xaml
File metadata and controls
44 lines (39 loc) · 1.66 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
40
41
42
43
44
<Window x:Class="DialogHost.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DialogHost"
WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="400" Width="600">
<Window.Resources>
<ResourceDictionary>
<DataTemplate DataType="{x:Type local:DialogViewModel}">
<local:DialogView/>
</DataTemplate>
<DataTemplate DataType="{x:Type local:DialogTextViewModel}">
<local:DialogTextView/>
</DataTemplate>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/DialogHost/DialogHost.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid Background="LightGray">
<Grid>
<StackPanel VerticalAlignment="Center"
HorizontalAlignment="Center">
<Button Content="Show dialog 1"
Command="{Binding CmdShowDialog}"
Height="26"
Width="100"
Margin="10"/>
<Button Content="Show dialog 2"
Command="{Binding CmdShowTextDialog}"
Height="26"
Width="100"
Margin="10"/>
</StackPanel>
</Grid>
<UserControl Template="{StaticResource DialogHostTemplate}"
DataContext="{Binding DialogHost}"/>
</Grid>
</Window>