2022-01-25 14:08:39 +01:00

360 lines
18 KiB
XML

<Application x:Class="HashCalculator.GUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:HashCalculator.GUI"
xmlns:c="clr-namespace:HashCalculator.GUI.Converters"
StartupUri="MainWindow.xaml">
<Application.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<c:ValueConverterAggregate x:Key="FalseToVisibilityConverter">
<c:BooleanInvertConverter />
<BooleanToVisibilityConverter />
</c:ValueConverterAggregate>
<c:ValueConverterAggregate x:Key="ValidInputEntryToVisibilityConverter">
<c:ValidInputEntryTypeToBooleanConverter />
<BooleanToVisibilityConverter />
</c:ValueConverterAggregate>
<c:ValueConverterAggregate x:Key="InvalidInputEntryToVisibilityConverter">
<c:ValidInputEntryTypeToBooleanConverter />
<c:BooleanInvertConverter />
<BooleanToVisibilityConverter />
</c:ValueConverterAggregate>
<c:ValueConverterAggregate x:Key="NullToVisibilityConverter">
<c:NullToBooleanConverter />
<c:BooleanInvertConverter />
<BooleanToVisibilityConverter />
</c:ValueConverterAggregate>
<c:ValueConverterAggregate x:Key="NotNullToVisibilityConverter">
<c:NullToBooleanConverter />
<BooleanToVisibilityConverter />
</c:ValueConverterAggregate>
<c:ValueConverterAggregate x:Key="NonZeroToVisibilityConverter">
<c:IsZeroToBooleanConverter />
<BooleanToVisibilityConverter />
</c:ValueConverterAggregate>
<c:MultiValueEqualityConverter x:Key="MultiValueEqualityConverter" />
<Style x:Key="CommonStyle" TargetType="Control">
<Setter
Property="Foreground"
Value="LightGray"
/>
<Setter
Property="Background"
Value="#202020"
/>
</Style>
<Style
TargetType="l:ShellLink"
>
<Setter
Property="Foreground"
Value="#30B0FF"
/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Red" />
</Trigger>
</Style.Triggers>
</Style>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="{x:Type TextBox}"
>
<Setter Property="Background" Value="#00000000"/>
</Style>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="{x:Type ComboBox}"
>
<Setter Property="Background" Value="#00000000"/>
</Style>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="{x:Type Button}"
x:Key="ButtonStyle"
>
<Setter Property="Background" Value="#20808080"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border
x:Name="ButtonBorderTemplate"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True"
>
<ContentPresenter
x:Name="ButtonContentPresenterTemplate"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="True">
<Setter Property="BorderBrush" TargetName="ButtonBorderTemplate" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="ButtonBorderTemplate" Value="#80BEE6FD"/>
<Setter Property="BorderBrush" TargetName="ButtonBorderTemplate" Value="#FF3C7FB1"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="ButtonBorderTemplate" Value="#80C4E5F6"/>
<Setter Property="BorderBrush" TargetName="ButtonBorderTemplate" Value="#FF2C628B"/>
</Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter Property="Background" TargetName="ButtonBorderTemplate" Value="#FFBCDDEE"/>
<Setter Property="BorderBrush" TargetName="ButtonBorderTemplate" Value="#FF245A83"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" TargetName="ButtonBorderTemplate" Value="#00000000"/>
<Setter Property="BorderBrush" TargetName="ButtonBorderTemplate" Value="#FFADB2B5"/>
<Setter Property="Foreground" Value="#808080"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style
BasedOn="{StaticResource ButtonStyle}"
TargetType="Button"
/>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="{x:Type DataGrid}"
/>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="{x:Type DataGridColumnHeader}"
>
<Setter Property="Padding" Value="10,5" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Background" Value="#343434"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0, 0, 1, 0"/>
<Setter Property="BorderBrush" Value="Gray" />
</Style>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="{x:Type DataGridRowHeader}"
/>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="{x:Type DataGridRow}"
/>
<Style TargetType="{x:Type Button}" x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}">
<Setter Property="Background" Value="Black" />
</Style>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="{x:Type ListBox}"
>
<Setter Property="Background" Value="#181818"/>
</Style>
<Style
BasedOn="{StaticResource CommonStyle}"
TargetType="CheckBox"
>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid
x:Name="TemplateRoot"
Background="Transparent"
SnapsToDevicePixels="True"
>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border
x:Name="CheckBoxBorder"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="1"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
>
<Grid x:Name="MarkGrid">
<Path
x:Name="OptionMark"
Data="F1M9.97498,1.22334L4.6983,9.09834 4.52164,9.09834 0,5.19331 1.27664,3.52165 4.255,6.08833 8.33331,1.52588E-05 9.97498,1.22334z"
Fill="LightGray"
Margin="1"
Opacity="0"
Stretch="None"
/>
<Rectangle
x:Name="IndeterminateMark"
Fill="LightGray"
Margin="2"
Opacity="0"
/>
</Grid>
</Border>
<ContentPresenter
x:Name="ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Grid.Column="1"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
/>
</Grid>
<ControlTemplate.Triggers>
<Trigger
Property="HasContent"
Value="True"
>
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="14,0,0,0"
SnapsToDevicePixels="True"
Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
StrokeThickness="1"
StrokeDashArray="1 2"
/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter
Property="Padding"
Value="4,-1,0,0"
/>
</Trigger>
<Trigger
Property="IsMouseOver"
Value="True"
>
<Setter
Property="Background"
TargetName="CheckBoxBorder"
Value="#80F3F9FF"
/>
<Setter
Property="BorderBrush"
TargetName="CheckBoxBorder"
Value="#FF5593FF"
/>
<Setter
Property="Fill"
TargetName="OptionMark"
Value="LightGray"
/>
<Setter
Property="Fill"
TargetName="IndeterminateMark"
Value="LightGray"
/>
</Trigger>
<Trigger
Property="IsEnabled"
Value="False"
>
<Setter
Property="Background"
TargetName="CheckBoxBorder"
Value="#FFE6E6E6"
/>
<Setter
Property="BorderBrush"
TargetName="CheckBoxBorder"
Value="#FFBCBCBC"
/>
<Setter
Property="Fill"
TargetName="OptionMark"
Value="#FF707070"
/>
<Setter
Property="Fill"
TargetName="IndeterminateMark"
Value="#FF707070"
/>
</Trigger>
<Trigger
Property="IsPressed"
Value="True"
>
<Setter
Property="Background"
TargetName="CheckBoxBorder"
Value="#80D9ECFF"
/>
<Setter
Property="BorderBrush"
TargetName="CheckBoxBorder"
Value="#FF3C77DD"
/>
<Setter
Property="Fill"
TargetName="OptionMark"
Value="LightGray"
/>
<Setter
Property="Fill"
TargetName="IndeterminateMark"
Value="LightGray"
/>
</Trigger>
<Trigger
Property="IsChecked"
Value="True"
>
<Setter
Property="Opacity"
TargetName="OptionMark"
Value="1"
/>
<Setter
Property="Opacity"
TargetName="IndeterminateMark"
Value="0"
/>
</Trigger>
<Trigger
Property="IsChecked"
Value="{x:Null}"
>
<Setter
Property="Opacity"
TargetName="OptionMark"
Value="0"
/>
<Setter
Property="Opacity"
TargetName="IndeterminateMark"
Value="1"
/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
</Application>