-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
KeyActionButtonsControl.xaml
53 lines (53 loc) · 4.33 KB
/
KeyActionButtonsControl.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
<UserControl x:Class="Leosac.KeyManager.Library.UI.KeyActionButtonsControl"
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:local="clr-namespace:Leosac.KeyManager.Library.UI"
xmlns:libuidomain="clr-namespace:Leosac.KeyManager.Library.UI.Domain"
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"
mc:Ignorable="d"
d:DesignHeight="50" d:DesignWidth="200">
<UserControl.Resources>
<ResourceDictionary>
<s:Boolean x:Key="True">True</s:Boolean>
<libuidomain:NullToBooleanConverter x:Key="NullToBooleanConverter" />
</ResourceDictionary>
</UserControl.Resources>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8">
<materialDesign:DialogHost Identifier="KeyGenerationDialog" DialogTheme="Inherit" DataContext="{Binding Path=Key, ElementName=userControl}">
<materialDesign:DialogHost.DialogContent>
<local:SymmetricKeyGenerationDialog KeySize="{Binding Path=KeySize, Mode=OneWay}" KeyValue="{Binding Materials[0].Value, Mode=TwoWay}" />
</materialDesign:DialogHost.DialogContent>
<Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}"
Width="24" Height="24" Margin="3"
ToolTip="{x:Static properties:Resources.KeyGeneration}"
IsEnabled="{Binding Path=Link.KeyStoreFavorite, Converter={StaticResource NullToBooleanConverter}, ConverterParameter={StaticResource True}}">
<materialDesign:PackIcon Kind="Seedling" Height="16" Width="16"/>
</Button>
</materialDesign:DialogHost>
<Button x:Name="btnKeyStoreLink" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Click="BtnKeyStoreLink_Click" Width="24" Height="24" ToolTip="{x:Static properties:Resources.LinkHelper}" Margin="3"
Visibility="{Binding ShowKeyLink, ElementName=userControl, Converter={StaticResource BooleanToVisibilityConverter}}">
<materialDesign:PackIcon Kind="KeyLink" Height="16" Width="16"/>
</Button>
<materialDesign:PopupBox PlacementMode="BottomAndAlignCentres" ToolTip="Export the key value" ToolTipService.Placement="Right" IsEnabled="{Binding Path=Link.KeyStoreFavorite, Converter={StaticResource NullToBooleanConverter}, ConverterParameter={StaticResource True}}">
<StackPanel>
<Button x:Name="btnCopy" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Click="BtnCopy_Click" Width="24" Height="24" ToolTip="{x:Static properties:Resources.CopyClipboard}" Margin="3">
<materialDesign:PackIcon Kind="ContentCopy" Height="16" Width="16"/>
</Button>
<Button x:Name="btnImport" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Click="BtnImport_Click" Width="24" Height="24" ToolTip="{x:Static properties:Resources.ImportFromFile}" Margin="3">
<materialDesign:PackIcon Kind="Import" Height="16" Width="16"/>
</Button>
<Button x:Name="btnExport" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Click="BtnExport_Click" Width="24" Height="24" ToolTip="{x:Static properties:Resources.ExportToFile}" Margin="3">
<materialDesign:PackIcon Kind="Export" Height="16" Width="16"/>
</Button>
<Button x:Name="btnPrint" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Click="BtnPrint_Click" Width="24" Height="24" ToolTip="{x:Static properties:Resources.KeyExportPrint}" Margin="3">
<materialDesign:PackIcon Kind="Printer" Height="16" Width="16"/>
</Button>
</StackPanel>
</materialDesign:PopupBox>
</StackPanel>
</UserControl>