-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMainWindow.xaml
149 lines (145 loc) · 9.16 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
<Controls:MetroWindow x:Class="BusinessCats.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:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:BusinessCats"
Title="Serious Business Cats for Serious Business"
Height="256" Width="624" Drop="Window_Drop" AllowDrop="True" Icon="Resources/BusinessCats.ico" ResizeMode="CanResizeWithGrip"
TitleCaps="False"
ShowMaxRestoreButton="False"
GlowBrush="{DynamicResource AccentColorBrush}"
MinWidth="512"
MinHeight="256"
SaveWindowPosition="True"
WindowTransitionsEnabled="False"
SnapsToDevicePixels="True"
x:Name="_this"
>
<Window.Resources>
<!--<Style TargetType="{x:Type ListBoxItem}">
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFF"></Setter>
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#F0FFFF"></Setter>
</Trigger>
</Style.Triggers>
</Style>-->
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Controls:ButtonHelper.PreserveTextCase" Value="True"/>
<Setter Property="Controls:ButtonHelper.CornerRadius" Value="0"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="FontSize" Value="12"/>
</Style>
</Window.Resources>
<Controls:MetroWindow.RightWindowCommands>
<Controls:WindowCommands>
<Button Click="btnRefresh_Click" ToolTip="Refresh the conversation list">
<Rectangle Width="20" Height="20"
Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
<Rectangle.OpacityMask>
<VisualBrush RenderOptions.CachingHint="Cache" Stretch="Fill"
Visual="{StaticResource appbar_refresh}" />
</Rectangle.OpacityMask>
</Rectangle>
</Button>
<Button Click="btnOpenFolder_Click" ToolTip="Open a box for cats to sit in">
<Rectangle Width="20" Height="20"
Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
<Rectangle.OpacityMask>
<VisualBrush RenderOptions.CachingHint="Cache" Stretch="Fill"
Visual="{StaticResource appbar_folder_open}" />
</Rectangle.OpacityMask>
</Rectangle>
</Button>
<ToggleButton ToolTip="Configure your business cats" IsChecked="{Binding ElementName=settingsFlyout, Path=IsOpen}">
<Rectangle Width="20" Height="20"
Fill="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton}, Path=Foreground}">
<Rectangle.OpacityMask>
<VisualBrush RenderOptions.CachingHint="Cache" Stretch="Fill"
Visual="{StaticResource appbar_settings}" />
</Rectangle.OpacityMask>
</Rectangle>
</ToggleButton>
</Controls:WindowCommands>
</Controls:MetroWindow.RightWindowCommands>
<Controls:MetroWindow.Flyouts>
<Controls:FlyoutsControl>
<Controls:Flyout x:Name="settingsFlyout" Header="Configure your business cats"
Position="Right"
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Controls:MetroWindow}, Path=ActualWidth, Mode=OneWay}">
<WrapPanel Orientation="Horizontal"
Margin="10">
<Controls:ToggleSwitch IsChecked="{Binding ElementName=_this, Path=IsDarkTheme }"
Header="Dark theme" Margin="10"/>
<Controls:ToggleSwitch IsChecked="{Binding ElementName=_this, Path=EatenByLions }"
Header="Get eaten by lions" Margin="10"/>
<Button Margin="10" Click="btnOpenFolder_Click">Open folder</Button>
</WrapPanel>
</Controls:Flyout>
</Controls:FlyoutsControl>
</Controls:MetroWindow.Flyouts>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="32"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="192"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ListBox x:Name="lbConversations" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel LastChildFill="True">
<Rectangle DockPanel.Dock="Left" Width="16"
Height="16"
Margin="1, 1, 4, 1"
HorizontalAlignment="Center" Fill="Gray">
<Rectangle.OpacityMask>
<VisualBrush RenderOptions.CachingHint="Cache" Stretch="Uniform"
Visual="{StaticResource appbar_nyan}" />
</Rectangle.OpacityMask>
</Rectangle>
<TextBlock Text="{Binding}" TextWrapping="Wrap"/>
</DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Slider x:Name="sliderBig" Height="32" Maximum="100" Value="100" TickFrequency="5" TickPlacement="BottomRight" ToolTip="This big." LargeChange="5" SmallChange="1" Grid.ColumnSpan="2" Grid.Row="1"/>
<DockPanel Grid.Column="1" Margin="4, 4, 4, 4" LastChildFill="True">
<Viewbox DockPanel.Dock="Top" Stretch="Uniform" Height="32" MinHeight="32">
<TextBlock x:Name="textBlock" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Top" Text="{Binding ElementName=lbConversations, Path=SelectedItem, TargetNullValue='Choose a conversation!'}" FontSize="18.667" TextAlignment="Center"/>
</Viewbox>
<Button DockPanel.Dock="Bottom" Content="Paste!" Click="btnPaste_Click" Margin="0, 4, 0, 0" ToolTip="you can dragon drop if you believe! clap your hands if you believe!!!" IsEnabled="{Binding SelectedItems.Count, ElementName=lbConversations}" FontSize="18.667" />
<Grid DockPanel.Dock="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="Snip and send" Click="btnSnipAndSend_Click" Margin="0, 4, 2, 0" ToolTip="you must snip it" IsEnabled="{Binding SelectedItems.Count, ElementName=lbConversations}" FontSize="18.667" />
<Button Grid.Column="1" Content="Snip" Click="btnSnip_Click" Margin="2, 4, 0, 0" ToolTip="snip it then clip it" FontSize="18.667" />
</Grid>
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Button x:Name="krahsWobniar" Visibility="{Binding ElementName=_this, Path=CanKrahsWobniarAllNight, Mode=OneTime, FallbackValue=Collapsed}" Content="krahswobniar" Click="btnKrahsWobniar_Click" Margin="4, 4, 4, 0" IsEnabled="{Binding SelectedItems.Count, ElementName=lbConversations}" ToolTip="hallowed be his name"/>
<Button Content="Blp!" Click="btnFlash_Click" Margin="4, 4, 4, 0" IsEnabled="{Binding SelectedItems.Count, ElementName=lbConversations}" ToolTip="like poking someone but even more annoying"/>
<Button Margin="4, 4, 4, 0" Click="btnSecret_Click" IsEnabled="{Binding SelectedItems.Count, ElementName=lbConversations}" ToolTip="the walls have ears">
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0, 0, 8, 0">Shh...</TextBlock>
<Rectangle DockPanel.Dock="Left" Width="16"
Height="16"
HorizontalAlignment="Center" Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
<Rectangle.OpacityMask>
<VisualBrush RenderOptions.CachingHint="Cache" Stretch="Uniform"
Visual="{StaticResource appbar_lock}" />
</Rectangle.OpacityMask>
</Rectangle>
</StackPanel>
</Button>
</WrapPanel>
</DockPanel>
</Grid>
</Controls:MetroWindow>