-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
SAMKeyStorePropertiesControl.xaml
72 lines (72 loc) · 5.72 KB
/
SAMKeyStorePropertiesControl.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<UserControl x:Class="Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.SAMKeyStorePropertiesControl"
xmlns="http:https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http:https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http:https://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http:https://schemas.microsoft.com/expression/blend/2008"
xmlns:domain="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Domain"
xmlns:libui="clr-namespace:Leosac.KeyManager.Library.UI;assembly=KeyManager.Library.UI"
xmlns:local="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI"
xmlns:materialDesign="http:https://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:properties="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Properties"
xmlns:wpfappctrls="clr-namespace:Leosac.WpfApp.Controls;assembly=WpfApp"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance domain:SAMKeyStorePropertiesControlViewModel}"
d:DesignHeight="200" d:DesignWidth="500">
<UserControl.Resources>
<domain:DESFireKeyTypeConverter x:Key="DESFireKeyTypeConverter" />
</UserControl.Resources>
<StackPanel>
<local:LLAReaderControl ReaderProvider="{Binding SAMProperties.ReaderProvider, Mode=TwoWay}" ReaderUnit="{Binding SAMProperties.ReaderUnit, Mode=TwoWay}" />
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
<ToggleButton IsChecked="{Binding SAMProperties.AutoSwitchToAV2}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.AutoSwitchToAV2}" Padding="3" />
</StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.AuthenticateKey}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<wpfappctrls:NumericUpDownControl MinValue="0" MaxValue="255" CurrentValue="{Binding SAMProperties.AuthenticateKeyEntryIdentifier, Mode=TwoWay}"
HelperText="{x:Static properties:Resources.KeyEntryIdentifierHelper}"
Hint="{x:Static properties:Resources.KeyEntryIdentifier}" Margin="5"/>
<ComboBox ItemsSource="{Binding KeyTypes}" SelectedItem="{Binding SAMProperties.AuthenticateKeyType}"
materialDesign:HintAssist.HelperText="{x:Static properties:Resources.KeyTypeHelper}"
materialDesign:HintAssist.Hint="{x:Static properties:Resources.KeyType}" Margin="5,5,5,15">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource DESFireKeyTypeConverter}}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<wpfappctrls:NumericUpDownControl MinValue="0" MaxValue="255" CurrentValue="{Binding SAMProperties.AuthenticateKeyVersion, Mode=TwoWay}"
HelperText="{x:Static properties:Resources.KeyVersionHelper}"
Hint="{x:Static properties:Resources.KeyVersion}" Margin="5"/>
<DockPanel>
<WrapPanel DockPanel.Dock="Right">
<ToggleButton IsChecked="{Binding Properties.StoreSecret, Mode=TwoWay}"
Style="{StaticResource MaterialDesignSwitchToggleButton}"
ToolTip="{x:Static properties:Resources.StoreSecret}"
Width="40">
<materialDesign:PackIcon Kind="ContentSave" RenderTransformOrigin=".5,.5">
<materialDesign:PackIcon.RenderTransform>
<RotateTransform Angle="45" />
</materialDesign:PackIcon.RenderTransform>
</materialDesign:PackIcon>
<materialDesign:ToggleButtonAssist.OnContent>
<materialDesign:PackIcon Kind="ContentSave" />
</materialDesign:ToggleButtonAssist.OnContent>
</ToggleButton>
</WrapPanel>
<PasswordBox materialDesign:HintAssist.HelperText="{x:Static properties:Resources.KeyValueHelper}"
materialDesign:HintAssist.Hint="{x:Static properties:Resources.KeyValue}"
materialDesign:TextFieldAssist.HasClearButton="True"
materialDesign:TextFieldAssist.CharacterCounterVisibility="Visible"
Style="{StaticResource MaterialDesignFloatingHintRevealPasswordBox}"
materialDesign:PasswordBoxAssist.Password="{Binding Properties.Secret, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
MaxLength="{Binding Properties.SecretMaxLength}" Margin="5" />
</DockPanel>
</StackPanel>
</Expander>
<ComboBox ItemsSource="{Binding CardTypes}" SelectedItem="{Binding SAMProperties.ForceCardType}"
materialDesign:HintAssist.HelperText="{x:Static properties:Resources.ForceCardTypeHelper}"
materialDesign:HintAssist.Hint="{x:Static properties:Resources.ForceCardType}"
materialDesign:TextFieldAssist.HasClearButton="True" Margin="5,5,5,5" />
</StackPanel>
</UserControl>