235 lines
11 KiB
XML
235 lines
11 KiB
XML
<Window
|
||
x:Class="HashCalculator.GUI.MainWindow"
|
||
x:Name="Self"
|
||
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:l="clr-namespace:HashCalculator.GUI"
|
||
xmlns:c="clr-namespace:HashCalculator.GUI.Converters"
|
||
mc:Ignorable="d"
|
||
Title="Sage FastHash 哈希计算器" Height="600" Width="600"
|
||
Background="#202020"
|
||
Foreground="LightGray"
|
||
>
|
||
<Window.Resources>
|
||
<c:ValueConverterAggregate x:Key="ValidInputEntryToVisibilityConverter">
|
||
<c:ValidInputEntryTypeToBooleanConverter />
|
||
<BooleanToVisibilityConverter />
|
||
</c:ValueConverterAggregate>
|
||
<c:ValueConverterAggregate x:Key="InvalidInputEntryToVisibilityConverter">
|
||
<c:ValidInputEntryTypeToBooleanConverter />
|
||
<c:BooleanInvertConverter />
|
||
<BooleanToVisibilityConverter />
|
||
</c:ValueConverterAggregate>
|
||
<Style x:Key="CommonStyle" TargetType="Control">
|
||
<Setter
|
||
Property="Foreground"
|
||
Value="{Binding Path=(TextElement.Foreground),
|
||
RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}}"
|
||
/>
|
||
<Setter
|
||
Property="Background"
|
||
Value="{Binding Path=(TextElement.Background),
|
||
RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}}"
|
||
/>
|
||
</Style>
|
||
<Style
|
||
BasedOn="{StaticResource CommonStyle}"
|
||
TargetType="{x:Type TextBox}"
|
||
>
|
||
<Setter Property="Background" Value="#00000000"/>
|
||
</Style>
|
||
<Style
|
||
BasedOn="{StaticResource CommonStyle}"
|
||
TargetType="{x:Type Button}"
|
||
>
|
||
<Setter Property="Background" Value="#20808080"/>
|
||
<Setter Property="Template">
|
||
<Setter.Value>
|
||
<ControlTemplate TargetType="{x:Type Button}">
|
||
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
||
<ContentPresenter x:Name="contentPresenter" 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="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||
</Trigger>
|
||
<Trigger Property="IsMouseOver" Value="True">
|
||
<Setter Property="Background" TargetName="border" Value="#80BEE6FD"/>
|
||
<Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
|
||
</Trigger>
|
||
<Trigger Property="IsPressed" Value="True">
|
||
<Setter Property="Background" TargetName="border" Value="#80C4E5F6"/>
|
||
<Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
|
||
</Trigger>
|
||
<Trigger Property="ToggleButton.IsChecked" Value="True">
|
||
<Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
|
||
<Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
|
||
</Trigger>
|
||
<Trigger Property="IsEnabled" Value="False">
|
||
<Setter Property="Background" TargetName="border" Value="#00000000"/>
|
||
<Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
|
||
<Setter Property="Foreground" Value="#808080"/>
|
||
</Trigger>
|
||
</ControlTemplate.Triggers>
|
||
</ControlTemplate>
|
||
</Setter.Value>
|
||
</Setter>
|
||
</Style>
|
||
<Style
|
||
BasedOn="{StaticResource CommonStyle}"
|
||
TargetType="{x:Type DataGrid}"
|
||
/>
|
||
<Style
|
||
BasedOn="{StaticResource CommonStyle}"
|
||
TargetType="{x:Type DataGridColumnHeader}"
|
||
>
|
||
<Setter Property="Padding" Value="10,5" />
|
||
<Setter Property="MinWidth" Value="0" />
|
||
<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 ListBox}"
|
||
>
|
||
<Setter Property="Background" Value="#181818"/>
|
||
</Style>
|
||
</Window.Resources>
|
||
<Window.DataContext>
|
||
<l:ViewModel/>
|
||
</Window.DataContext>
|
||
<Grid Margin="10,20,10,10">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition/>
|
||
<RowDefinition Height="130" />
|
||
</Grid.RowDefinitions>
|
||
<DockPanel Grid.Row="0">
|
||
<Grid
|
||
DockPanel.Dock="Top"
|
||
Height="25"
|
||
>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition />
|
||
<ColumnDefinition Width="92"/>
|
||
</Grid.ColumnDefinitions>
|
||
<l:InputBar
|
||
HintText="输入文本,或 big/manifest/xml 文件路径"
|
||
Text="{Binding MainInput.Text}"
|
||
Collection="{Binding MainInput.Items}"
|
||
SelectedItem="{Binding MainInput.SelectedItem}"
|
||
SelectedIndex="{Binding MainInput.SelectedIndex}"
|
||
Grid.Column="0"
|
||
Margin="0,0,10,0"
|
||
/>
|
||
<Button
|
||
Content="浏览文件"
|
||
Command="{Binding MainInput.BrowseCommand}"
|
||
CommandParameter="{Binding ElementName=Self}"
|
||
Visibility="{Binding MainInput.SelectedItem, Converter={StaticResource InvalidInputEntryToVisibilityConverter}}"
|
||
Grid.Column="1"
|
||
Margin="0"
|
||
/>
|
||
<Button
|
||
Content="确认"
|
||
Command="{Binding MainInput.SelectCommand}"
|
||
CommandParameter="{Binding}"
|
||
Visibility="{Binding MainInput.SelectedItem, Converter={StaticResource ValidInputEntryToVisibilityConverter}}"
|
||
Grid.Column="1"
|
||
Margin="0"
|
||
Foreground="#20FF30"
|
||
BorderBrush="#20FF30"
|
||
/>
|
||
</Grid>
|
||
<Grid
|
||
DockPanel.Dock="Top"
|
||
Height="25"
|
||
Margin="0,10,0,0"
|
||
Visibility="Visible"
|
||
>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition />
|
||
<ColumnDefinition Width="92"/>
|
||
</Grid.ColumnDefinitions>
|
||
<l:InputBar
|
||
HintText="输入 big 文件里包含的 manifest 文件的路径"
|
||
Collection="{Binding Items}"
|
||
SelectedItem="{Binding SelectedItem}"
|
||
Grid.Column="0"
|
||
Margin="0,0,10,0"
|
||
/>
|
||
<Button
|
||
Content="确认"
|
||
Grid.Column="1"
|
||
Margin="0"
|
||
Foreground="ForestGreen"
|
||
BorderBrush="ForestGreen" Template="{DynamicResource ButtonBaseControlTemplate1}"
|
||
/>
|
||
</Grid>
|
||
<DockPanel
|
||
DockPanel.Dock="Top"
|
||
Height="25"
|
||
Margin="0,10"
|
||
>
|
||
<Button
|
||
DockPanel.Dock="Right"
|
||
Content="取消加载"
|
||
Grid.Column="1"
|
||
Width="92"
|
||
/>
|
||
<Button
|
||
DockPanel.Dock="Right"
|
||
Content="加载 csf / mod.str"
|
||
Grid.Column="1"
|
||
Width="140"
|
||
Margin="10,0"
|
||
/>
|
||
<TextBlock
|
||
Text="正在加载……"
|
||
VerticalAlignment="Center"
|
||
Grid.Column="0"
|
||
/>
|
||
</DockPanel>
|
||
<l:InputBar
|
||
HintText="过滤Asset ID(可选)"
|
||
Collection="{Binding Items}"
|
||
SelectedItem="{Binding SelectedItem}"
|
||
DockPanel.Dock="Top"
|
||
Height="25"
|
||
/>
|
||
<DataGrid
|
||
x:Name="DataGrid"
|
||
AutoGenerateColumns="False"
|
||
ScrollViewer.CanContentScroll="True"
|
||
VerticalScrollBarVisibility="Auto"
|
||
EnableRowVirtualization="True"
|
||
VirtualizingPanel.VirtualizationMode="Recycling"
|
||
DockPanel.Dock="Top"
|
||
>
|
||
<DataGrid.Columns>
|
||
<DataGridTextColumn Header="Asset ID" Width="200" Binding="{Binding AssetId}"/>
|
||
<DataGridTextColumn Header="哈希" Width="*" Binding="{Binding Hash}"/>
|
||
</DataGrid.Columns>
|
||
</DataGrid>
|
||
</DockPanel>
|
||
<TextBlock
|
||
x:Name="textBlock"
|
||
Grid.Row="1"
|
||
Margin="0,10,0,0"
|
||
TextWrapping="Wrap"
|
||
>
|
||
本工具基于 <l:ShellLink NavigateUri="https://github.com/Qibbi">Qibbi</l:ShellLink> 提供的 TechnologyAssembler 制作<LineBreak />
|
||
此外使用了 <l:ShellLink NavigateUri="https://github.com/bgrainger">Bradley Grainger</l:ShellLink> 的
|
||
<l:ShellLink NavigateUri="https://github.com/bgrainger/IndexRange">IndexRange</l:ShellLink>
|
||
从而能在 .NET Standard 2.0 上使用 C# 8.0 的末尾索引操作符<LineBreak />
|
||
<LineBreak />
|
||
假如你对本工具有任何疑问或者建议的话,可以来到<l:ShellLink NavigateUri="https://tieba.baidu.com/ra3">红警3吧</l:ShellLink>发帖寻找岚依(
|
||
</TextBlock>
|
||
</Grid>
|
||
</Window>
|