mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-25 12:24:12 +08:00
60 lines
3.0 KiB
XML
60 lines
3.0 KiB
XML
<Grid x:Class="GameRes.Formats.GUI.WidgetINT"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:s="clr-namespace:GameRes.Formats.Strings"
|
|
xmlns:fmt="clr-namespace:GameRes.Formats"
|
|
xmlns:local="clr-namespace:GameRes.Formats.GUI"
|
|
MaxWidth="260">
|
|
<Grid.Resources>
|
|
<local:KeyConverter 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>
|
|
</Grid.Resources>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition MinWidth="130" Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Label Content="{x:Static s:arcStrings.INTLabelNumericKey}" Target="{Binding ElementName=Passkey}"
|
|
Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right"/>
|
|
<TextBox Name="Passkey" Grid.Column="1" Grid.Row="0" Margin="0,3,0,3">
|
|
<TextBox.Text>
|
|
<Binding Path="Key" Converter="{StaticResource keyConverter}" UpdateSourceTrigger="PropertyChanged">
|
|
<Binding.ValidationRules>
|
|
<local:PasskeyRule/>
|
|
</Binding.ValidationRules>
|
|
</Binding>
|
|
</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>
|
|
<Label Content="{x:Static s:arcStrings.INTLabelPassphrase}" Target="{Binding ElementName=Passphrase}"
|
|
Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right"/>
|
|
<TextBox Name="Passphrase" Grid.Column="1" Grid.Row="1" Margin="0,3,0,3"
|
|
Text="{Binding Path=Password}"/>
|
|
<Label Content="{x:Static s:arcStrings.INTLabelScheme}" Target="{Binding ElementName=EncScheme}"
|
|
Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right"/>
|
|
<ComboBox Name="EncScheme" Grid.Column="1" Grid.Row="2" Margin="0,3,0,0"
|
|
ItemsSource="{Binding Source={x:Static fmt:IntOpener.KnownSchemes}, Path=Keys, Mode=OneWay}"
|
|
Width="{Binding ElementName=Passkey, Path=ActualWidth}"
|
|
SelectedValue="{Binding Path=Scheme}"/>
|
|
</Grid>
|