-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
SAMSymmetricKeyEntryPropertiesControl.xaml
148 lines (148 loc) · 12.5 KB
/
SAMSymmetricKeyEntryPropertiesControl.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<UserControl x:Class="Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.SAMSymmetricKeyEntryPropertiesControl"
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:local="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI"
xmlns:libuidomain="clr-namespace:Leosac.KeyManager.Library.UI.Domain;assembly=KeyManager.Library.UI"
xmlns:libui="clr-namespace:Leosac.KeyManager.Library.UI;assembly=KeyManager.Library.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"
xmlns:wpfappdomain="clr-namespace:Leosac.WpfApp.Domain;assembly=WpfApp"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance domain:SAMSymmetricKeyEntryPropertiesControlViewModel}"
d:DesignHeight="500" d:DesignWidth="500">
<UserControl.Resources>
<wpfappdomain:ByteArrayToStringConverter x:Key="ByteArrayToStringConverter" />
<libuidomain:NullToBooleanConverter x:Key="NullToBooleanConverter" />
</UserControl.Resources>
<StackPanel>
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.Options}" IsExpanded="True">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<ComboBox Grid.Row="0" Grid.ColumnSpan="2" ItemsSource="{Binding SAMKeyEntryTypes}" SelectedItem="{Binding Properties.SAMKeyEntryType}"
materialDesign:HintAssist.HelperText="{x:Static properties:Resources.KeyEntryTypeHelper}"
materialDesign:HintAssist.Hint="{x:Static properties:Resources.KeyEntryType}" Margin="5,5,5,10" />
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="1" Grid.Column="0" Margin="5">
<ToggleButton IsChecked="{Binding Properties.EnableDumpSessionKey}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.EnableDumpSessionKey}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="2" Grid.Column="0" Margin="5">
<ToggleButton IsChecked="{Binding Properties.CryptoBasedOnSecretKey}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.CryptoBasedSecretKey}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="3" Grid.Column="0" Margin="5">
<ToggleButton IsChecked="{Binding Properties.KeepIV}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.KeepIV}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="4" Grid.Column="0" Margin="5">
<ToggleButton IsChecked="{Binding Properties.LockUnlock}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.LockUnlock}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="5" Grid.Column="0" Margin="5">
<ToggleButton IsChecked="{Binding Properties.AuthenticateHost}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.AuthenticateHost}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="6" Grid.Column="0" Margin="5">
<ToggleButton IsChecked="{Binding Properties.AllowDumpSecretKey}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.AllowDumpSecretKey}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="7" Grid.Column="0" Margin="5">
<ToggleButton IsChecked="{Binding Properties.AllowDumpSecretKeyWithDiv}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.AllowDumpSecretKeyWithDiv}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" Margin="5">
<ToggleButton IsChecked="{Binding Properties.DisableChangeKeyPICC}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.DisableChangeKeyPICC}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="2" Grid.Column="1" Margin="5">
<ToggleButton IsChecked="{Binding Properties.DisableDecryptData}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.DisableDecryptData}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="3" Grid.Column="1" Margin="5">
<ToggleButton IsChecked="{Binding Properties.DisableEncryptData}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.DisableEncryptData}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="4" Grid.Column="1" Margin="5">
<ToggleButton IsChecked="{Binding Properties.DisableVerifyMACFromPICC}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.DisableVerifyMACFromPICC}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="5" Grid.Column="1" Margin="5">
<ToggleButton IsChecked="{Binding Properties.DisableGenerateMACFromPICC}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.DisableGenerateMACFromPICC}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="6" Grid.Column="1" Margin="5">
<ToggleButton IsChecked="{Binding Properties.DisableKeyEntry}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.DisableKeyEntry}" Padding="3" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="7" Grid.Column="1" Margin="5">
<ToggleButton IsChecked="{Binding Properties.ReservedForPerso}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.ReservedForPerso}" Padding="3" />
</StackPanel>
</Grid>
</StackPanel>
</Expander>
</StackPanel>
</materialDesign:Card>
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.KUC}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="0" Margin="5">
<ToggleButton IsChecked="{Binding Properties.KeyUsageCounter, Mode=TwoWay, Converter={StaticResource NullToBooleanConverter}}" Style="{StaticResource MaterialDesignSwitchLightToggleButton}" />
<TextBlock Text="{x:Static properties:Resources.Enabled}" Padding="3" />
</StackPanel>
<wpfappctrls:NumericUpDownControl MinValue="0" MaxValue="15" CurrentValue="{Binding Properties.KeyUsageCounter, Mode=TwoWay}" Grid.Row="1"
HelperText="{x:Static properties:Resources.KUCReferenceHelper}"
Hint="{x:Static properties:Resources.KUCReference}"/>
</Grid>
</StackPanel>
</Expander>
</StackPanel>
</materialDesign:Card>
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.DESFire}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Text="{Binding Properties.DESFireAID, Mode=TwoWay, Converter={StaticResource ByteArrayToStringConverter}}"
materialDesign:HintAssist.HelperText="{x:Static properties:Resources.DESFireAIDHelper}"
materialDesign:HintAssist.Hint="{x:Static properties:Resources.DESFireAID}" Margin="0,0,0,10"/>
<wpfappctrls:NumericUpDownControl MinValue="0" MaxValue="255" CurrentValue="{Binding Properties.DESFireKeyNum, Mode=TwoWay}" Grid.Row="1"
HelperText="{x:Static properties:Resources.DESFireKeyNumberHelper}"
Hint="{x:Static properties:Resources.DESFireKeyNumber}"/>
</Grid>
</StackPanel>
</Expander>
</StackPanel>
</materialDesign:Card>
<local:ChangeKeyReferenceControl ChangeKeyRefId="{Binding Properties.ChangeKeyRefId, Mode=TwoWay}" ChangeKeyRefVersion="{Binding Properties.ChangeKeyRefVersion, Mode=TwoWay}"/>
</StackPanel>
</UserControl>