-
Notifications
You must be signed in to change notification settings - Fork 135
/
Copy pathMainWindow.xaml
171 lines (169 loc) · 10.3 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
160
161
162
163
164
165
166
167
168
169
170
171
<Window x:Class="VirtualDesktopShowcase.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:l="clr-namespace:VirtualDesktopShowcase"
mc:Ignorable="d"
Title="VirtualDesktop.Showcase"
SizeToContent="WidthAndHeight"
SnapsToDevicePixels="True"
FontSize="16">
<DockPanel>
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"
Padding="8">
<DockPanel>
<Panel.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="Padding"
Value="20,4" />
<Setter Property="HorizontalContentAlignment"
Value="Left" />
<Setter Property="Margin"
Value="8" />
<Setter Property="BorderThickness"
Value=".99" />
</Style>
</Panel.Resources>
<GroupBox DockPanel.Dock="Left"
Header=" Control "
Margin="8">
<StackPanel Margin="8">
<Button Content="Create new"
Click="CreateNew" />
<Button Content="Switch left"
Click="SwitchLeft" />
<Button Content="Switch right"
Click="SwitchRight" />
<Button Content="Remove"
Click="Remove" />
</StackPanel>
</GroupBox>
<GroupBox DockPanel.Dock="Left"
Header=" Control (with window)"
Margin="8">
<StackPanel Margin="8">
<Button Content="Create new and move"
Click="CreateNewAndMove" />
<Button Content="Switch left and move"
Click="SwitchLeftAndMove" />
<Button Content="Switch right and move"
Click="SwitchRightAndMove" />
<Button Content="Pin / Unpin"
Click="Pin" />
<Button Content="Pin / Unpin (App)"
Click="PinApp" />
<Border Background="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
Height=".99"
Margin="8" />
<StackPanel Margin="6">
<RadioButton x:Name="ThisWindowMenu"
IsChecked="True"
VerticalContentAlignment="Center">
<TextBlock Text="This window" />
</RadioButton>
<Border Height="4" />
<RadioButton VerticalContentAlignment="Center">
<TextBlock>
<Run>Foreground window</Run>
<LineBreak />
<Run FontSize="14">(seconds later)</Run>
</TextBlock>
</RadioButton>
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox Header=" Virtual desktops "
Margin="8">
<ItemsControl Margin="8"
ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:MainWindow}}, Path=Desktops}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type l:VirtualDesktopViewModel}">
<Button x:Name="outerBorder"
Click="SwitchDesktop">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Setters>
<Setter Property="BorderBrush"
Value="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" />
<Setter Property="BorderThickness"
Value=".99" />
<Setter Property="Margin"
Value="8" />
<Setter Property="Opacity"
Value="0.75" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="Transparent">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style.Setters>
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="BorderBrush"
Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
<Setter Property="Opacity"
Value="1.0" />
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
<DockPanel>
<StackPanel x:Name="texts"
Margin="8">
<TextBlock Text="{Binding Name, Mode=OneWay}" />
<TextBlock Text="{Binding Id, Mode=OneWay}"
FontSize="12" />
<TextBlock Text="{Binding ShowcaseMessage, Mode=OneWay}"
FontSize="12" />
</StackPanel>
<Button Click="ChangeWallpaper"
Height="{Binding ElementName=texts, Path=ActualHeight}"
Margin="8">
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<ContentPresenter />
</ControlTemplate>
</Button.Template>
<Image Source="{Binding WallpaperPath}"
StretchDirection="DownOnly"
Stretch="Uniform"
HorizontalAlignment="Right" />
</Button>
</DockPanel>
</Button>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsCurrent}"
Value="True">
<DataTrigger.Setters>
<Setter TargetName="outerBorder"
Property="BorderBrush"
Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
<Setter TargetName="outerBorder"
Property="BorderThickness"
Value="2.99" />
<Setter TargetName="outerBorder"
Property="Margin"
Value="6" />
<Setter TargetName="outerBorder"
Property="Opacity"
Value="1.0" />
</DataTrigger.Setters>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DockPanel>
</ScrollViewer>
</DockPanel>
</Window>