-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
123 lines (123 loc) · 6.22 KB
/
MainWindow.xaml
File metadata and controls
123 lines (123 loc) · 6.22 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<Window
x:Class="Lemon.ModuleNavigation.WpfSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:lm="https://github.com/NeverMorewd/Lemon.ModuleNavigation"
xmlns:local="clr-namespace:Lemon.ModuleNavigation.WpfSample"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
Width="800"
Height="450"
mc:Ignorable="d">
<Grid>
<TabControl>
<TabItem Header="View">
<Grid ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<Label Content="Views" />
<Button
Margin="0,4,0,0"
Command="{Binding NavigateToViewCommand}"
CommandParameter="ViewAlpha"
Content="ViewAlpha" />
<Button
Margin="0,4,0,0"
Command="{Binding NavigateToViewCommand}"
CommandParameter="ViewBeta"
Content="ViewBeta" />
<Button
Margin="0,4,0,0"
Command="{Binding NavigateToViewCommand}"
CommandParameter="ViewAlpha.RequestNew"
Content="ViewAlpha.RequestNew" />
<Button
Margin="0,4,0,0"
Command="{Binding NavigateToViewCommand}"
CommandParameter="ViewBeta.RequestNew"
Content="ViewBeta.RequestNew" />
</StackPanel>
<StackPanel Grid.Column="1">
<Label Content="ContentControl" />
<Border />
<ContentControl lm:NavigationExtension.RegionName="ContentRegion" />
</StackPanel>
<StackPanel Grid.Column="2">
<Label Content="TabControl" />
<Border />
<TabControl lm:NavigationExtension.RegionName="TabRegion">
<TabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Alias}" />
<Button
Width="20"
Height="20"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Command="{Binding DataContext.UnloadViewCommand, RelativeSource={RelativeSource AncestorType=TabControl}}"
CommandParameter="{Binding}"
Content="x"
ToolTip="UnloadView" />
</StackPanel>
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
</StackPanel>
<StackPanel Grid.Column="3">
<Label Content="ItemsControl" />
<Border />
<ListBox
MaxHeight="600"
Margin="2"
lm:NavigationExtension.RegionName="ItemsRegion"
Background="Transparent"
BorderBrush="LemonChiffon"
BorderThickness="1" />
</StackPanel>
</Grid>
</TabItem>
<TabItem Header="Dialog">
<StackPanel Width="300" Orientation="Vertical">
<Label Content="Dialogs" />
<Button
Command="{Binding ShowCommand}"
CommandParameter="{Binding Path=Tag, RelativeSource={RelativeSource Mode=Self}}"
Content="ViewAlpha.Show"
Tag="ViewAlpha" />
<Button
Command="{Binding ShowCommand}"
CommandParameter="{Binding Path=Tag, RelativeSource={RelativeSource Mode=Self}}"
Content="ViewBeta.Show"
Tag="ViewBeta" />
<Button
Command="{Binding ShowDialogCommand}"
CommandParameter="{Binding Path=Tag, RelativeSource={RelativeSource Mode=Self}}"
Content="ViewAlpha.ShowDialog"
Tag="ViewAlpha" />
<Button
Command="{Binding ShowDialogCommand}"
CommandParameter="{Binding Path=Tag, RelativeSource={RelativeSource Mode=Self}}"
Content="ViewBeta.ShowDialog"
Tag="ViewBeta" />
<Button
Command="{Binding ShowDialogSyncCommand}"
CommandParameter="{Binding Path=Tag, RelativeSource={RelativeSource Mode=Self}}"
Content="ViewAlpha.ShowDialogSync"
Tag="ViewAlpha" />
<Button
Command="{Binding ShowDialogSyncCommand}"
CommandParameter="{Binding Path=Tag, RelativeSource={RelativeSource Mode=Self}}"
Content="ViewBeta.ShowDialogSync"
Tag="ViewBeta" />
</StackPanel>
</TabItem>
</TabControl>
</Grid>
</Window>