-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
223 lines (202 loc) · 15 KB
/
Copy pathMainWindow.xaml
File metadata and controls
223 lines (202 loc) · 15 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
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<Window x:Class="CrosshairY.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:local="clr-namespace:CrosshairY"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen" FontFamily="Segoe UI"
Title="CrosshairY"
Height="710" Width="1100"
MinHeight="500" MinWidth="800"
WindowStyle="None" Background="{StaticResource BackgroundBrush}" ResizeMode="CanResizeWithGrip">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="1" ResizeBorderThickness="5" CaptionHeight="0"/>
</WindowChrome.WindowChrome>
<Border Padding="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="7*" MaxHeight="60"/>
<RowDefinition Height="93*"/>
</Grid.RowDefinitions>
<!-- Custom Title Bar -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="0" Grid.ColumnSpan="2" MouseLeftButtonDown="OnWindowHeaderMouseDown" Background="{StaticResource SidebarBrush}" >
<Image Source="/assets/logo.png" MaxHeight="60" Margin="10"/>
<Viewbox Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="8" MaxHeight="40">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock Text="CrosshairY" Foreground="{StaticResource ForegroundBrush}" FontWeight="Medium" FontSize="16" VerticalAlignment="Center"/>
<TextBlock Text="by tsgsOFFICIAL" FontStyle="Italic" Foreground="{StaticResource ForegroundBrush}"/>
</StackPanel>
<TextBlock Text="{Binding VersionString, StringFormat='Version {0}', FallbackValue='Version N/A'}" Margin="10,0,0,0" FontStyle="Italic" Foreground="{StaticResource ForegroundBrush}" VerticalAlignment="Bottom"/>
</StackPanel>
</Viewbox>
</StackPanel>
<!-- Window Controls -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Stretch" Grid.ColumnSpan="2">
<Button x:Name="MinimizeButton" Width="44" Background="Transparent" BorderThickness="0" Click="OnMinimizeButtonClicked">
<Path Data="M0,5 L10,5" Stroke="{StaticResource MutedForegroundBrush}" StrokeThickness="1"/>
</Button>
<Button x:Name="MaximizeButton" Width="44" Background="Transparent" BorderThickness="0" Click="OnMaximizeButtonClicked">
<Rectangle Width="10" Height="10" Stroke="{StaticResource MutedForegroundBrush}" StrokeThickness="1"/>
</Button>
<Button x:Name="CloseButton" Width="44" Background="Transparent" BorderThickness="0" Click="OnCloseButtonClicked">
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource DestructiveBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
<Path Data="M0,0 L10,10 M10,0 L0,10" Stroke="{StaticResource MutedForegroundBrush}" StrokeThickness="1"/>
</Button>
</StackPanel>
<!-- Sidebar -->
<Border Grid.Row="1" Background="{StaticResource SidebarBrush}" BorderBrush="{StaticResource BorderBrush}" BorderThickness="0,0,1,0">
<StackPanel>
<RadioButton x:Name="NavHome" Style="{StaticResource NavButton}" IsChecked="True" Checked="WhenNavButtonIsChecked" Margin="0,0,0,4">
<StackPanel Orientation="Horizontal">
<icon:PackIconGameIcons Kind="House" Width="16" Height="16" Margin="0,0,12,0" VerticalAlignment="Center" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RadioButton}}" />
<TextBlock Text="Home" VerticalAlignment="Center" />
</StackPanel>
</RadioButton>
<RadioButton x:Name="NavDesigner" Style="{StaticResource NavButton}" Checked="WhenNavButtonIsChecked" Margin="0,0,0,4">
<StackPanel Orientation="Horizontal">
<icon:PackIconGameIcons Kind="Crosshair" Width="16" Height="16" Margin="0,0,12,0" VerticalAlignment="Center" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RadioButton}}" />
<TextBlock Text="Designer" VerticalAlignment="Center" />
</StackPanel>
</RadioButton>
<RadioButton x:Name="NavLibrary" Style="{StaticResource NavButton}" Checked="WhenNavButtonIsChecked" Margin="0,0,0,4">
<StackPanel Orientation="Horizontal">
<icon:PackIconGameIcons Kind="Bookshelf" Width="16" Height="16" Margin="0,0,12,0" VerticalAlignment="Center" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RadioButton}}" />
<TextBlock Text="Library" VerticalAlignment="Center" />
</StackPanel>
</RadioButton>
<RadioButton x:Name="NavSettings" Style="{StaticResource NavButton}" Checked="WhenNavButtonIsChecked">
<StackPanel Orientation="Horizontal">
<icon:PackIconGameIcons Kind="SettingsKnobs" Width="16" Height="16" Margin="0,0,12,0" VerticalAlignment="Center" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RadioButton}}" />
<TextBlock Text="Settings" VerticalAlignment="Center" />
</StackPanel>
</RadioButton>
</StackPanel>
</Border>
<!-- Page Content -->
<Frame x:Name="MainFrame" Grid.Column="1" Grid.Row="1" NavigationUIVisibility="Hidden" Background="{StaticResource BackgroundBrush}" />
<!-- NotifyIcon, that minimizes to system tray -->
<tb:TaskbarIcon x:Name="MyNotifyIcon" IconSource="/Assets/logo.png" ToolTipText="CrosshairY by tsgsOFFICIAL" DataContext="{Binding RelativeSource={RelativeSource AncestorType=Window}}" Visibility="Collapsed">
<tb:TaskbarIcon.ContextMenu>
<ContextMenu>
<!--MenuItem with centered icon and text-->
<MenuItem Header="CrosshairY" IsEnabled="False" Foreground="LightGray">
<MenuItem.Icon>
<Canvas Width="24" Height="24" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Assets/logo.png" Width="24" Height="24" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="6, 0"/>
</Canvas>
</MenuItem.Icon>
</MenuItem>
<Separator Margin="0"/>
<MenuItem x:Name="JoinDiscord" Header="Join Discord" Command="{Binding JoinDiscordCommand}">
<MenuItem.Icon>
<Canvas Width="24" Height="24" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/assets/discord.png" Width="24" Height="24" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="6, 0"/>
</Canvas>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="OpenGithub" Header="Open Github" Command="{Binding OpenGithubCommand}">
<MenuItem.Icon>
<Canvas Width="24" Height="24" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/assets/github.png" Width="24" Height="24" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="6, 0"/>
</Canvas>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="MinimizeAndRestore" Header="Minimize" Command="{Binding ToggleWindowCommand}" />
<MenuItem Header="Exit" Command="{Binding CloseCommand}" />
<!--Define a style for the ContextMenu-->
<ContextMenu.Resources>
<!--Set background and foreground colors for MenuItems-->
<Style TargetType="MenuItem">
<Setter Property="Background" Value="#353535"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontFamily" Value="Segoe UI"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Padding" Value="10, 6"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Margin" Value="0,1,0,1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<Grid VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Width="16" Margin="2,5,5,5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
<ContentPresenter ContentSource="Header" Grid.Column="1" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Icon" Value="{x:Null}">
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter Property="Background" TargetName="templateRoot" Value="#999999"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="LightGray"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Style for the ContextMenu itself-->
<Style TargetType="ContextMenu">
<Setter Property="Background" Value="#353535"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContextMenu">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="6"
SnapsToDevicePixels="True"
Padding="10">
<Grid>
<ItemsPresenter/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Style for separators-->
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border Height="1" Margin="4,4,4,0" Background="LightGray" HorizontalAlignment="Stretch"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ContextMenu.Resources>
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
</Grid>
</Border>
</Window>