mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(GalFormat): use string representation of keys instead of numeric.
This commit is contained in:
@@ -5,41 +5,16 @@
|
||||
xmlns:p="clr-namespace:GameRes.Formats.Properties"
|
||||
xmlns:local="clr-namespace:GameRes.Formats.GUI"
|
||||
MaxWidth="250" Orientation="Vertical">
|
||||
<StackPanel.Resources>
|
||||
<local:GaleKeyConverter x:Key="keyConverter"/>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Validation.HasError" Value="true">
|
||||
<Setter Property="ToolTip"
|
||||
Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<Label HorizontalAlignment="Left" Margin="0,0,5,5" Padding="0">
|
||||
<TextBlock Text="{x:Static s:arcStrings.GALChoose}" TextWrapping="WrapWithOverflow"/>
|
||||
</Label>
|
||||
<ComboBox Name="Title" ItemsSource="{Binding}"
|
||||
SelectedValue="{Binding ElementName=Key, Path=Text, Converter={StaticResource keyConverter}}"
|
||||
SelectedValue="{Binding ElementName=Key, Path=Text}"
|
||||
SelectedValuePath="Value" DisplayMemberPath="Key"
|
||||
Width="200" HorizontalAlignment="Left"/>
|
||||
<TextBox Name="Key" Width="200" HorizontalAlignment="Left" Margin="0,5,0,0">
|
||||
<TextBox.Text>
|
||||
<Binding Source="{x:Static p:Settings.Default}" Path="GALKey" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" Converter="{StaticResource keyConverter}">
|
||||
<Binding.ValidationRules>
|
||||
<local:GaleKeyRule/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
<Binding Source="{x:Static p:Settings.Default}" Path="GALKey" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"/>
|
||||
</TextBox.Text>
|
||||
<Validation.ErrorTemplate>
|
||||
<ControlTemplate>
|
||||
<DockPanel>
|
||||
<TextBlock DockPanel.Dock="Right" Foreground="Red" FontWeight="Bold" Text="!" VerticalAlignment="Center"/>
|
||||
<Border BorderBrush="Red" BorderThickness="1">
|
||||
<AdornedElementPlaceholder Name="ValidationAdorner" />
|
||||
</Border>
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Validation.ErrorTemplate>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
|
||||
Reference in New Issue
Block a user