|
31 | 31 | <RowDefinition Height="8" /> |
32 | 32 | <RowDefinition Height="2*" /> |
33 | 33 | </Grid.RowDefinitions> |
34 | | - <ComboBox HorizontalAlignment="Left" VerticalAlignment="Center" SelectedItem="{Binding DisplayMode, Mode=TwoWay}"> |
35 | | - <ComboBox.Items> |
36 | | - <local:DisplayMode>Hex</local:DisplayMode> |
37 | | - <local:DisplayMode>CSharp</local:DisplayMode> |
38 | | - </ComboBox.Items> |
39 | | - </ComboBox> |
| 34 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> |
| 35 | + <ComboBox SelectedItem="{Binding DisplayMode, Mode=TwoWay}"> |
| 36 | + <ComboBox.Items> |
| 37 | + <local:DisplayMode>Hex</local:DisplayMode> |
| 38 | + <local:DisplayMode>CSharp</local:DisplayMode> |
| 39 | + </ComboBox.Items> |
| 40 | + </ComboBox> |
| 41 | + <ComboBox Margin="8,0,0,0" SelectedItem="{Binding KeyMode, Mode=TwoWay}"> |
| 42 | + <ComboBox.Items> |
| 43 | + <local:KeyMode>Raw</local:KeyMode> |
| 44 | + <local:KeyMode>CspBlob</local:KeyMode> |
| 45 | + </ComboBox.Items> |
| 46 | + </ComboBox> |
| 47 | + </StackPanel> |
40 | 48 | <Button Grid.Column="2" Command="ApplicationCommands.New" HorizontalAlignment="Center">Generate Key Pair</Button> |
41 | 49 | <GroupBox Grid.Row="2" Grid.ColumnSpan="3" Header="Public Key" Style="{StaticResource MaterialDesignCardGroupBox}"> |
42 | 50 | <Grid> |
|
47 | 55 | </Grid.RowDefinitions> |
48 | 56 | <TextBlock Text="{Binding PublicKey, Converter={StaticResource BytesToHexValueConverter}}" FontFamily="Courier New" TextWrapping="Wrap"> |
49 | 57 | <TextBlock.Visibility> |
50 | | - <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToVisibilityValueConverter}"> |
51 | | - <Binding.ConverterParameter> |
52 | | - <local:DisplayMode>Hex</local:DisplayMode> |
53 | | - </Binding.ConverterParameter> |
54 | | - </Binding> |
| 58 | + <MultiBinding Mode="OneWay" Converter="{StaticResource AllBooleanToVisibilityMultiValueConverter}"> |
| 59 | + <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 60 | + <Binding.ConverterParameter> |
| 61 | + <local:DisplayMode>Hex</local:DisplayMode> |
| 62 | + </Binding.ConverterParameter> |
| 63 | + </Binding> |
| 64 | + <Binding Path="KeyMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 65 | + <Binding.ConverterParameter> |
| 66 | + <local:KeyMode>Raw</local:KeyMode> |
| 67 | + </Binding.ConverterParameter> |
| 68 | + </Binding> |
| 69 | + </MultiBinding> |
55 | 70 | </TextBlock.Visibility> |
56 | 71 | </TextBlock> |
57 | 72 | <TextBlock Text="{Binding PublicKey, Converter={StaticResource BytesToCSharpValueConverter}}" FontFamily="Courier New" TextWrapping="Wrap"> |
58 | 73 | <TextBlock.Visibility> |
59 | | - <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToVisibilityValueConverter}"> |
60 | | - <Binding.ConverterParameter> |
61 | | - <local:DisplayMode>CSharp</local:DisplayMode> |
62 | | - </Binding.ConverterParameter> |
63 | | - </Binding> |
| 74 | + <MultiBinding Mode="OneWay" Converter="{StaticResource AllBooleanToVisibilityMultiValueConverter}"> |
| 75 | + <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 76 | + <Binding.ConverterParameter> |
| 77 | + <local:DisplayMode>CSharp</local:DisplayMode> |
| 78 | + </Binding.ConverterParameter> |
| 79 | + </Binding> |
| 80 | + <Binding Path="KeyMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 81 | + <Binding.ConverterParameter> |
| 82 | + <local:KeyMode>Raw</local:KeyMode> |
| 83 | + </Binding.ConverterParameter> |
| 84 | + </Binding> |
| 85 | + </MultiBinding> |
| 86 | + </TextBlock.Visibility> |
| 87 | + </TextBlock> |
| 88 | + <TextBlock Text="{Binding PublicCspBlob, Converter={StaticResource BytesToHexValueConverter}}" FontFamily="Courier New" TextWrapping="Wrap"> |
| 89 | + <TextBlock.Visibility> |
| 90 | + <MultiBinding Mode="OneWay" Converter="{StaticResource AllBooleanToVisibilityMultiValueConverter}"> |
| 91 | + <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 92 | + <Binding.ConverterParameter> |
| 93 | + <local:DisplayMode>Hex</local:DisplayMode> |
| 94 | + </Binding.ConverterParameter> |
| 95 | + </Binding> |
| 96 | + <Binding Path="KeyMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 97 | + <Binding.ConverterParameter> |
| 98 | + <local:KeyMode>CspBlob</local:KeyMode> |
| 99 | + </Binding.ConverterParameter> |
| 100 | + </Binding> |
| 101 | + </MultiBinding> |
| 102 | + </TextBlock.Visibility> |
| 103 | + </TextBlock> |
| 104 | + <TextBlock Text="{Binding PublicCspBlob, Converter={StaticResource BytesToCSharpValueConverter}}" FontFamily="Courier New" TextWrapping="Wrap"> |
| 105 | + <TextBlock.Visibility> |
| 106 | + <MultiBinding Mode="OneWay" Converter="{StaticResource AllBooleanToVisibilityMultiValueConverter}"> |
| 107 | + <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 108 | + <Binding.ConverterParameter> |
| 109 | + <local:DisplayMode>CSharp</local:DisplayMode> |
| 110 | + </Binding.ConverterParameter> |
| 111 | + </Binding> |
| 112 | + <Binding Path="KeyMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 113 | + <Binding.ConverterParameter> |
| 114 | + <local:KeyMode>CspBlob</local:KeyMode> |
| 115 | + </Binding.ConverterParameter> |
| 116 | + </Binding> |
| 117 | + </MultiBinding> |
64 | 118 | </TextBlock.Visibility> |
65 | 119 | </TextBlock> |
66 | 120 | <Button Grid.Row="2" HorizontalAlignment="Right" Command="ApplicationCommands.Copy" CommandParameter="PublicKey">Copy Public Key</Button> |
|
75 | 129 | </Grid.RowDefinitions> |
76 | 130 | <TextBlock Text="{Binding PrivateKey, Converter={StaticResource BytesToHexValueConverter}}" FontFamily="Courier New" TextWrapping="Wrap"> |
77 | 131 | <TextBlock.Visibility> |
78 | | - <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToVisibilityValueConverter}"> |
79 | | - <Binding.ConverterParameter> |
80 | | - <local:DisplayMode>Hex</local:DisplayMode> |
81 | | - </Binding.ConverterParameter> |
82 | | - </Binding> |
| 132 | + <MultiBinding Mode="OneWay" Converter="{StaticResource AllBooleanToVisibilityMultiValueConverter}"> |
| 133 | + <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 134 | + <Binding.ConverterParameter> |
| 135 | + <local:DisplayMode>Hex</local:DisplayMode> |
| 136 | + </Binding.ConverterParameter> |
| 137 | + </Binding> |
| 138 | + <Binding Path="KeyMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 139 | + <Binding.ConverterParameter> |
| 140 | + <local:KeyMode>Raw</local:KeyMode> |
| 141 | + </Binding.ConverterParameter> |
| 142 | + </Binding> |
| 143 | + </MultiBinding> |
83 | 144 | </TextBlock.Visibility> |
84 | 145 | </TextBlock> |
85 | 146 | <TextBlock Text="{Binding PrivateKey, Converter={StaticResource BytesToCSharpValueConverter}}" FontFamily="Courier New" TextWrapping="Wrap"> |
86 | 147 | <TextBlock.Visibility> |
87 | | - <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToVisibilityValueConverter}"> |
88 | | - <Binding.ConverterParameter> |
89 | | - <local:DisplayMode>CSharp</local:DisplayMode> |
90 | | - </Binding.ConverterParameter> |
91 | | - </Binding> |
| 148 | + <MultiBinding Mode="OneWay" Converter="{StaticResource AllBooleanToVisibilityMultiValueConverter}"> |
| 149 | + <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 150 | + <Binding.ConverterParameter> |
| 151 | + <local:DisplayMode>CSharp</local:DisplayMode> |
| 152 | + </Binding.ConverterParameter> |
| 153 | + </Binding> |
| 154 | + <Binding Path="KeyMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 155 | + <Binding.ConverterParameter> |
| 156 | + <local:KeyMode>Raw</local:KeyMode> |
| 157 | + </Binding.ConverterParameter> |
| 158 | + </Binding> |
| 159 | + </MultiBinding> |
| 160 | + </TextBlock.Visibility> |
| 161 | + </TextBlock> |
| 162 | + <TextBlock Text="{Binding PrivateCspBlob, Converter={StaticResource BytesToHexValueConverter}}" FontFamily="Courier New" TextWrapping="Wrap"> |
| 163 | + <TextBlock.Visibility> |
| 164 | + <MultiBinding Mode="OneWay" Converter="{StaticResource AllBooleanToVisibilityMultiValueConverter}"> |
| 165 | + <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 166 | + <Binding.ConverterParameter> |
| 167 | + <local:DisplayMode>Hex</local:DisplayMode> |
| 168 | + </Binding.ConverterParameter> |
| 169 | + </Binding> |
| 170 | + <Binding Path="KeyMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 171 | + <Binding.ConverterParameter> |
| 172 | + <local:KeyMode>CspBlob</local:KeyMode> |
| 173 | + </Binding.ConverterParameter> |
| 174 | + </Binding> |
| 175 | + </MultiBinding> |
| 176 | + </TextBlock.Visibility> |
| 177 | + </TextBlock> |
| 178 | + <TextBlock Text="{Binding PrivateCspBlob, Converter={StaticResource BytesToCSharpValueConverter}}" FontFamily="Courier New" TextWrapping="Wrap"> |
| 179 | + <TextBlock.Visibility> |
| 180 | + <MultiBinding Mode="OneWay" Converter="{StaticResource AllBooleanToVisibilityMultiValueConverter}"> |
| 181 | + <Binding Path="DisplayMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 182 | + <Binding.ConverterParameter> |
| 183 | + <local:DisplayMode>CSharp</local:DisplayMode> |
| 184 | + </Binding.ConverterParameter> |
| 185 | + </Binding> |
| 186 | + <Binding Path="KeyMode" Mode="OneWay" Converter="{StaticResource EqualityToBooleanValueConverter}"> |
| 187 | + <Binding.ConverterParameter> |
| 188 | + <local:KeyMode>CspBlob</local:KeyMode> |
| 189 | + </Binding.ConverterParameter> |
| 190 | + </Binding> |
| 191 | + </MultiBinding> |
92 | 192 | </TextBlock.Visibility> |
93 | 193 | </TextBlock> |
94 | 194 | <Button Grid.Row="2" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignRaisedAccentButton}" Command="ApplicationCommands.Copy" CommandParameter="PrivateKey">Copy Private Key</Button> |
|
0 commit comments