(GalFormat): use string representation of keys instead of numeric.

This commit is contained in:
morkt
2016-06-10 06:27:21 +04:00
parent cb04b322f2
commit dd9ed869c5
11 changed files with 25 additions and 92 deletions

View File

@@ -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>