-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
AsymmetricKeyGenerationDialog.xaml
60 lines (60 loc) · 4.19 KB
/
AsymmetricKeyGenerationDialog.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
<UserControl x:Class="Leosac.KeyManager.Library.UI.AsymmetricKeyGenerationDialog"
x:Name="userControl"
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.UI.Domain"
xmlns:local="clr-namespace:Leosac.KeyManager.Library.UI"
xmlns:materialDesign="http:https://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:properties="clr-namespace:Leosac.KeyManager.Library.UI.Properties"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:wpfappctrls="clr-namespace:Leosac.WpfApp.Controls;assembly=WpfApp"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
MinWidth="500" MaxWidth="800">
<UserControl.Resources>
<s:Boolean x:Key="True">True</s:Boolean>
<s:Boolean x:Key="False">False</s:Boolean>
</UserControl.Resources>
<Grid>
<DockPanel LastChildFill="True">
<TextBlock DockPanel.Dock="Top" Text="{x:Static properties:Resources.KeyGeneration}" FontSize="18" Margin="8" />
<StackPanel DockPanel.Dock="Top" Orientation="Vertical" Margin="5">
<wpfappctrls:NumericUpDownControl Hint="{x:Static properties:Resources.KeySize}" HelperText="{x:Static properties:Resources.KeySizeHelper}" MinValue="8" CurrentValue="{Binding KeySize, ElementName=userControl, Mode=TwoWay}" Margin="8" />
<PasswordBox Margin="5"
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 Path=KeyValue, ElementName=userControl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True}" />
</StackPanel>
<WrapPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,5,5,5">
<Button Width="100" IsDefault="True" Content="{x:Static properties:Resources.Close}" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" Margin="15,0,0,0"/>
</WrapPanel>
<TabControl TabStripPlacement="Left" Margin="5,15,5,5">
<TabItem Header="{x:Static properties:Resources.Random}">
<Grid>
<Button x:Name="btnRandom" Content="{x:Static properties:Resources.GenerateRandom}" HorizontalAlignment="Center" VerticalAlignment="Center" Click="BtnRandom_Click"/>
</Grid>
</TabItem>
<TabItem Header="{x:Static properties:Resources.Seed}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{x:Static properties:Resources.CreateFromSeed}" Margin="10"/>
<local:SymmetricKeyControl Grid.Row="1" Key="{Binding Path=SeedKey, Mode=TwoWay, ElementName=userControl}" ShowKeyLink="False" />
<Button x:Name="btnCreateFromSeed" Grid.Row="2" Content="{x:Static properties:Resources.Create}" Width="150" Click="BtnCreateFromSeed_Click" Margin="10" />
</Grid>
</TabItem>
<TabItem Header="{x:Static properties:Resources.KeyCeremony}">
<local:KeyCeremonySetupControl KeyValue="{Binding Path=KeyValue, Mode=TwoWay, ElementName=userControl}"/>
</TabItem>
</TabControl>
</DockPanel>
</Grid>
</UserControl>