-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
136 lines (135 loc) · 8.22 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
<Window x:Class="DesktopIconHiderWPF.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:DesktopIconHiderWPF"
mc:Ignorable="d"
Title="VirtualDesktop.Showcase"
SizeToContent="WidthAndHeight"
SnapsToDevicePixels="True"
FontSize="16"
Height="400"
Width="500">
<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="Remove"
Click="Remove" />
<Separator Height="13"/>
<Button x:Name="IconsToggle" Content="Hide Icons" Click="IconsToggle_Click"/>
</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"
Height="50">
<TextBlock Text="{Binding Name, Mode=OneWay}" />
<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"
Height="50"/>
</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>