-
Notifications
You must be signed in to change notification settings - Fork 319
/
MainWindow.xaml
159 lines (154 loc) · 8.04 KB
/
MainWindow.xaml
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!--
************************************************************************
AvalonDock
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL
************************************************************************
-->
<Window x:Class="TestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:avalonDock="https://github.com/Dirkster99/AvalonDock"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:TestApp"
xmlns:winformsIntegration="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
Title="MainWindow"
Width="525"
Height="350"
UseLayoutRounding="True">
<Grid x:Name="layoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Menu Grid.Row="0">
<MenuItem Header="Edit">
<MenuItem Command="Undo" />
<MenuItem Command="Redo" />
<Separator />
<MenuItem Command="Cut" />
<MenuItem Command="Copy" />
<MenuItem Command="Paste" />
</MenuItem>
<MenuItem Header="Layout">
<MenuItem Header="Save">
<MenuItem Click="OnSaveLayout" Header="Layout_1" />
<MenuItem Click="OnSaveLayout" Header="Layout_2" />
<MenuItem Click="OnSaveLayout" Header="Layout_3" />
<MenuItem Click="OnSaveLayout" Header="Layout_4" />
</MenuItem>
<MenuItem Header="Load">
<MenuItem Click="OnLoadLayout" Header="Layout_1" />
<MenuItem Click="OnLoadLayout" Header="Layout_2" />
<MenuItem Click="OnLoadLayout" Header="Layout_3" />
<MenuItem Click="OnLoadLayout" Header="Layout_4" />
</MenuItem>
<MenuItem Click="OnDumpToConsole" Header="Dump To Console" />
<MenuItem Click="OnUnloadManager" Header="Unload Manager" />
<MenuItem Click="OnLoadManager" Header="Load Manager" />
<MenuItem Click="OnShowHeader" Header="Show header" />
</MenuItem>
<MenuItem Header="Tools">
<MenuItem Click="OnShowWinformsWindow" Header="WinForms Window" />
<MenuItem Click="OnShowToolWindow1" Header="Tool Window1" />
<MenuItem Click="OnNewFloatingWindow" Header="New floating window" />
</MenuItem>
</Menu>
<DockingManager x:Name="dockManager"
Grid.Row="1"
AllowMixedOrientation="True"
AutoWindowSizeWhenOpened="True"
DocumentClosing="DockManager_DocumentClosing"
IsVirtualizingAnchorable="True"
IsVirtualizingDocument="True">
<DockingManager.Theme>
<Vs2013LightTheme />
</DockingManager.Theme>
<DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Margin="0,0,4,0" Source="{Binding IconSource}" />
<TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis" />
</StackPanel>
</DataTemplate>
</DockingManager.DocumentHeaderTemplate>
<LayoutRoot PropertyChanged="OnLayoutRootPropertyChanged">
<LayoutPanel Orientation="Horizontal">
<LayoutAnchorablePane DockWidth="50">
<LayoutAnchorable x:Name="WinFormsWindow"
Title="WinForms Window"
CanClose="False"
CanHide="False"
ContentId="WinFormsWindow"
ToolTip="My WinForms Tool">
<winformsIntegration:WindowsFormsHost x:Name="winFormsHost" Background="White" />
</LayoutAnchorable>
</LayoutAnchorablePane>
<LayoutDocumentPaneGroup>
<LayoutDocumentPane x:Name="LayoutDocumentPane">
<LayoutDocument
Title="Document 1"
ContentId="document1"
IconSource="/TestApp;component/Images/alarm-clock-blue.png">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button
Height="28"
VerticalAlignment="Top"
Click="AddTwoDocuments_click"
Content="Click to add 2 documents" />
<TextBox Grid.Row="1" Text="Document 1 Content" />
</Grid>
</LayoutDocument>
<LayoutDocument Title="Document 2" ContentId="document2">
<TextBox
Background="Transparent"
BorderThickness="0"
Foreground="White"
Text="{Binding TestTimer, Mode=OneWay, StringFormat='Document 2 Attached to Timer ->\{0\}'}" />
</LayoutDocument>
</LayoutDocumentPane>
</LayoutDocumentPaneGroup>
<LayoutAnchorablePaneGroup DockWidth="50">
<LayoutAnchorablePane>
<LayoutAnchorable
Title="Tool Window 1"
ContentId="toolWindow1"
Hiding="OnToolWindow1Hiding">
<StackPanel MinHeight="450">
<local:TestUserControl />
<TextBox Text="{Binding TestTimer, Mode=OneWay, StringFormat='Tool Window 1 Attached to Timer ->\{0\}'}" />
</StackPanel>
</LayoutAnchorable>
<LayoutAnchorable Title="Tool Window 2" ContentId="toolWindow2">
<TextBlock Text="{Binding FocusedElement}" />
</LayoutAnchorable>
</LayoutAnchorablePane>
</LayoutAnchorablePaneGroup>
</LayoutPanel>
<LayoutRoot.LeftSide>
<LayoutAnchorSide>
<LayoutAnchorGroup>
<LayoutAnchorable
Title="AutoHide1 Content"
ContentId="AutoHide1Content"
IconSource="/TestApp;component/Images/address-book--pencil.png">
<TextBox Text="{Binding TestTimer, Mode=OneWay, StringFormat='AutoHide Attached to Timer ->\{0\}'}" />
</LayoutAnchorable>
<LayoutAnchorable Title="AutoHide2 Content" ContentId="AutoHide2Content">
<StackPanel Orientation="Vertical">
<TextBox />
<TextBox />
</StackPanel>
</LayoutAnchorable>
</LayoutAnchorGroup>
</LayoutAnchorSide>
</LayoutRoot.LeftSide>
</LayoutRoot>
</DockingManager>
</Grid>
</Window>