-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMainWindow.xaml
169 lines (167 loc) · 11.4 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
<Window x:Name="window" x:Class="Z_Toolbar.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:qc="http://QuickConverter.CodePlex.com/"
xmlns:svh="clr-namespace:Z_Toolbar.Tools"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
mc:Ignorable="d"
Title="Z Toolbar" Background="Transparent" Top="-140" Opacity="0.2" Left="{Binding Source={x:Static SystemParameters.FullPrimaryScreenWidth}, Converter={StaticResource ResourceKey=WCC}}" FontFamily="Roboto" ResizeMode="NoResize" WindowStyle="None" Height="145" WindowStartupLocation="Manual" AllowsTransparency="True"
VisualTextRenderingMode="ClearType" Initialized="window_Initialized" Width="800" UseLayoutRounding="True" Topmost="True" MouseEnter="window_MouseEnter" MouseLeave="window_MouseLeave" ShowInTaskbar="False">
<Grid Background="Black" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" Width="{qc:Binding '$P*0.87', P={Binding ElementName=window, Path=ActualWidth}}" Height="{qc:Binding '$P*0.87', P={Binding ElementName=window, Path=ActualHeight}}">
<Grid.Effect>
<DropShadowEffect BlurRadius="20" Direction="0"/>
</Grid.Effect>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Name="menu">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<tb:TaskbarIcon IconSource="Resources/mainIcon.ico" ToolTipText="ZToolbar">
<tb:TaskbarIcon.Resources>
<ResourceDictionary Source="UiComponents/MessageboxButton.xaml"/>
</tb:TaskbarIcon.Resources>
<tb:TaskbarIcon.ContextMenu>
<ContextMenu>
<ContextMenu.Template>
<ControlTemplate>
<Border BorderBrush="White" BorderThickness="1">
<Grid Height="150" Width="100" Background="Black">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Image Source="Resources/contextMenuBanner.png" HorizontalAlignment="Stretch"/>
<Button Grid.Row="1" Height="50" Foreground="White" Style="{StaticResource MessageboxButtonStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Click="MenuItem_Click" FontSize="15" FontFamily="Roboto">Exit</Button>
</Grid>
</Border>
</ControlTemplate>
</ContextMenu.Template>
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
<Menu Background="Black">
<Menu.Resources>
<ResourceDictionary Source="UiComponents/MenuItemStyle.xaml"/>
</Menu.Resources>
<MenuItem Header="_Add File" Click="MenuItem_Click_plus" Background="Black" Foreground="White" FontFamily="Roboto" FontWeight="Bold" FontSize="14" Padding="8,1,8,1" Template="{DynamicResource MenuItemControlTemplate}">
<MenuItem.Icon>
<Image Source="Resources/plus.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Add F_older" Click="MenuItem_Click_Folder" Background="Black" Foreground="White" FontFamily="Roboto" FontWeight="Bold" FontSize="14" Padding="8,1,8,1" Template="{DynamicResource MenuItemControlTemplate}">
<MenuItem.Icon>
<Image Source="Resources/plus.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="E_dit" Name="edit_button" x:FieldModifier="public" Background="Black" Foreground="White" FontFamily="Roboto" FontWeight="Bold" FontSize="14" Padding="8,1,8,1" Template="{DynamicResource MenuItemControlTemplate}" IsCheckable="True">
<MenuItem.Icon>
<Image Source="Resources/edit.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Properties" Click="MenuItem_Click_Prop" Background="Black" Foreground="White" FontFamily="Roboto" FontWeight="Bold" FontSize="14" Padding="8,1,8,1" Template="{DynamicResource MenuItemControlTemplate}">
<MenuItem.Icon>
<Image Source="Resources/cog.png"/>
</MenuItem.Icon>
</MenuItem>
</Menu>
<Menu Grid.Column="1" Background="Black">
<Menu.Resources>
<ResourceDictionary Source="UiComponents/MenuItemStyle.xaml"/>
</Menu.Resources>
<MenuItem Padding="0" PreviewMouseDown="window_MouseDown" Template="{DynamicResource MenuItemControlTemplate}">
<MenuItem.Icon>
<Image Source="Resources/drag.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Exit" Name="exit_button" Background="Black" Foreground="White" FontFamily="Roboto" FontWeight="Bold" FontSize="14" Click="MenuItem_Click" Padding="8,1,8,1" Template="{DynamicResource MenuItemControlTemplate}">
<MenuItem.Icon>
<Image Source="Resources/exit.png"/>
</MenuItem.Icon>
</MenuItem>
</Menu>
</Grid>
<ListView PreviewMouseWheel="lv_PreviewMouseWheel" Background="Black" BorderBrush="Black" Name="lv" Padding="0,3,0,3" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.CanContentScroll="False">
<ListView.Resources>
<ResourceDictionary Source="UiComponents/ListViewBundle.xaml"/>
</ListView.Resources>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Background="Transparent" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid Name="LItem" Background="Black" VerticalAlignment="Stretch">
<Grid.Resources>
<Style TargetType="ToolTip">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<Border Padding="4" Background="Black" BorderBrush="White" BorderThickness="1">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Grid.ToolTip>
<StackPanel Orientation="Horizontal" Background="Black">
<Image RenderOptions.BitmapScalingMode="HighQuality" Height="25" Width="25" Source="Resources/information.png"/>
<TextBlock VerticalAlignment="Center" Margin="3,0,1,0" Foreground="White" Text="{Binding Name}"/>
</StackPanel>
</Grid.ToolTip>
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="1" Text="{Binding Name}" TextTrimming="CharacterEllipsis" TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="ClearType" Foreground="White" DockPanel.Dock="Bottom" HorizontalAlignment="Center" FontFamily="Roboto Light" FontSize="9"></TextBlock>
<Image RenderOptions.BitmapScalingMode="NearestNeighbor" Source="{Binding IconBytes}"/>
<Button Name="DelButton" Command="{Binding DelCommand}" CommandParameter="{Binding Path}" IsEnabled="False" Opacity="0" Height="25" Width="25" Style="{StaticResource DelButton}" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Grow}, Event=PointerOver}">
<Image Source="/Resources/del.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RenderOptions.BitmapScalingMode="HighQuality"/>
</Button>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=edit_button}" Value="true">
<Setter TargetName="DelButton" Property="IsEnabled" Value="True"/>
<Setter TargetName="DelButton" Property="Opacity" Value="1"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border Name="itemBorder" Margin="4,0,4,0" BorderThickness="1" Background="Transparent" Padding="5">
<Button Style="{StaticResource RunButton}" Command="{Binding RunCommand}" CommandParameter="{Binding Path}">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="itemBorder" Property="BorderBrush" Value="#FF333333"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
</ListView>
</Grid>
</Window>