GUI: Added checkbox to enable/disable "legacy" compatibility mode.
[slunkcrypt.git] / gui / App.xaml
blobfee01ba52d08bb8b05edb391ab98cfcda02191e0
1 <Application x:Class="com.muldersoft.slunkcrypt.gui.App"
2              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4              StartupUri="SlunkCryptGUI.xaml">
5     
6     <Application.Resources>
7         <Style TargetType="{x:Type FrameworkElement}" x:Key="DisableWhileBusy">
8             <Setter Property="IsEnabled" Value="true"/>
9             <Style.Triggers>
10                 <DataTrigger Binding="{Binding IsBusy, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Value="true">
11                     <Setter Property="IsEnabled" Value="false"/>
12                 </DataTrigger>
13             </Style.Triggers>
14         </Style>
15         <Style TargetType="{x:Type FrameworkElement}" x:Key="EnableWhileBusy">
16             <Setter Property="IsEnabled" Value="false"/>
17             <Style.Triggers>
18                 <DataTrigger Binding="{Binding IsBusy, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Value="true">
19                     <Setter Property="IsEnabled" Value="true"/>
20                 </DataTrigger>
21             </Style.Triggers>
22         </Style>
23         <Style TargetType="{x:Type FrameworkElement}" x:Key="HitInvisibleWhileBusy">
24             <Setter Property="IsEnabled" Value="true"/>
25             <EventSetter Event="PreviewDragEnter"            Handler="FrameworkElement_PreviewUserInputEvent"/>
26             <EventSetter Event="PreviewDragOver"             Handler="FrameworkElement_PreviewUserInputEvent"/>
27             <EventSetter Event="PreviewDrop"                 Handler="FrameworkElement_PreviewUserInputEvent"/>
28             <EventSetter Event="PreviewGotKeyboardFocus"     Handler="FrameworkElement_PreviewUserInputEvent"/>
29             <EventSetter Event="PreviewKeyDown"              Handler="FrameworkElement_PreviewUserInputEvent"/>
30             <EventSetter Event="PreviewKeyUp"                Handler="FrameworkElement_PreviewUserInputEvent"/>
31             <EventSetter Event="PreviewMouseDown"            Handler="FrameworkElement_PreviewUserInputEvent"/>
32             <EventSetter Event="PreviewMouseLeftButtonDown"  Handler="FrameworkElement_PreviewUserInputEvent"/>
33             <EventSetter Event="PreviewMouseLeftButtonUp"    Handler="FrameworkElement_PreviewUserInputEvent"/>
34             <EventSetter Event="PreviewMouseRightButtonDown" Handler="FrameworkElement_PreviewUserInputEvent"/>
35             <EventSetter Event="PreviewMouseRightButtonUp"   Handler="FrameworkElement_PreviewUserInputEvent"/>
36             <EventSetter Event="PreviewMouseUp"              Handler="FrameworkElement_PreviewUserInputEvent"/>
37             <EventSetter Event="PreviewMouseWheel"           Handler="FrameworkElement_PreviewUserInputEvent"/>
38             <EventSetter Event="PreviewStylusButtonDown"     Handler="FrameworkElement_PreviewUserInputEvent"/>
39             <EventSetter Event="PreviewStylusButtonUp"       Handler="FrameworkElement_PreviewUserInputEvent"/>
40             <EventSetter Event="PreviewStylusDown"           Handler="FrameworkElement_PreviewUserInputEvent"/>
41             <EventSetter Event="PreviewStylusInRange"        Handler="FrameworkElement_PreviewUserInputEvent"/>
42             <EventSetter Event="PreviewStylusSystemGesture"  Handler="FrameworkElement_PreviewUserInputEvent"/>
43             <EventSetter Event="PreviewStylusUp"             Handler="FrameworkElement_PreviewUserInputEvent"/>
44             <EventSetter Event="PreviewTextInput"            Handler="FrameworkElement_PreviewUserInputEvent"/>
45             <EventSetter Event="PreviewTouchDown"            Handler="FrameworkElement_PreviewUserInputEvent"/>
46             <EventSetter Event="PreviewTouchUp"              Handler="FrameworkElement_PreviewUserInputEvent"/>
47             <Style.Triggers>
48                 <DataTrigger Binding="{Binding IsBusy, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Value="true">
49                     <Setter Property="IsHitTestVisible" Value="false"/>
50                 </DataTrigger>
51             </Style.Triggers>
52         </Style>
53         <Style TargetType="{x:Type FrameworkElement}" x:Key="WaitCursorWhileBusy">
54             <Style.Triggers>
55                 <DataTrigger Binding="{Binding IsBusy, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Value="true">
56                     <Setter Property="Cursor" Value="Wait"/>
57                     <Setter Property="ForceCursor" Value="true"/>
58                 </DataTrigger>
59             </Style.Triggers>
60         </Style>
61         <Style TargetType="{x:Type TextBlock}" x:Key="HighlightIfSelected">
62             <Style.Triggers>
63                 <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=TabItem}}" Value="true">
64                     <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"/>
65                 </DataTrigger>
66             </Style.Triggers>
67         </Style>
68         <Style TargetType="{x:Type Image}" x:Key="GrayOutIfDisabled">
69             <Setter Property="Opacity" Value="1.0"/>
70             <Style.Triggers>
71                 <Trigger Property="IsEnabled" Value="False">
72                     <Setter Property="Opacity" Value="0.5"/>
73                 </Trigger>
74             </Style.Triggers>
75         </Style>
76         <Style TargetType="{x:Type FrameworkElement}" x:Key="HideIfNotEmpty">
77             <Setter Property="Visibility" Value="Collapsed"/>
78             <Style.Triggers>
79                 <DataTrigger Binding="{Binding Count}" Value="0">
80                     <Setter Property="Visibility" Value="Visible"/>
81                 </DataTrigger>
82             </Style.Triggers>
83         </Style>
84         <Style TargetType="{x:Type ListViewItem}" x:Key="ItemToolTips">
85             <Setter Property="ToolTip">
86                 <Setter.Value>
87                     <ToolTip Content="{Binding Chars}"/>
88                 </Setter.Value>
89             </Setter>
90         </Style>
91     </Application.Resources>
92 </Application>