2025-11-23 20:56:57 +01:00
|
|
|
<abstract:SignatureAndEncryptionPageAbstract
|
|
|
|
|
x:Class="Wino.Views.Settings.SignatureAndEncryptionPage"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:abstract="using:Wino.Views.Abstract"
|
2026-03-27 12:57:44 +01:00
|
|
|
xmlns:crypt="using:System.Security.Cryptography.X509Certificates"
|
2025-11-23 20:56:57 +01:00
|
|
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:domain="using:Wino.Core.Domain"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
mc:Ignorable="d">
|
|
|
|
|
|
|
|
|
|
<ScrollViewer>
|
|
|
|
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
|
|
|
|
<StackPanel.ChildrenTransitions>
|
|
|
|
|
<TransitionCollection>
|
|
|
|
|
<RepositionThemeTransition IsStaggeringEnabled="False" />
|
|
|
|
|
</TransitionCollection>
|
|
|
|
|
</StackPanel.ChildrenTransitions>
|
|
|
|
|
<controls:SettingsExpander
|
2026-03-19 16:41:35 +01:00
|
|
|
Description="{x:Bind domain:Translator.SettingsSignatureAndEncryption_MyCertificatesDescription, Mode=OneTime}"
|
|
|
|
|
Header="{x:Bind domain:Translator.SettingsSignatureAndEncryption_MyCertificatesHeader, Mode=OneTime}"
|
2025-11-23 20:56:57 +01:00
|
|
|
IsExpanded="True">
|
|
|
|
|
<controls:SettingsExpander.Items>
|
|
|
|
|
<controls:SettingsCard>
|
|
|
|
|
<!--TODO: Not working
|
|
|
|
|
<TextBlock Visibility="{Binding ViewModel.PersonalCertificatesEmpty, Mode=OneWay}">
|
|
|
|
|
<Run Text="There are no items." />
|
|
|
|
|
</TextBlock>-->
|
|
|
|
|
|
|
|
|
|
<ListView
|
|
|
|
|
x:Name="PersonalCertList"
|
|
|
|
|
MaxHeight="180"
|
|
|
|
|
ItemsSource="{x:Bind ViewModel.PersonalCertificates, Mode=OneWay}"
|
|
|
|
|
SelectionChanged="PersonalCertList_SelectionChanged"
|
|
|
|
|
SelectionMode="Multiple">
|
|
|
|
|
<ListView.Header>
|
|
|
|
|
<Grid Padding="16,12" ColumnSpacing="16">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="26" />
|
|
|
|
|
<ColumnDefinition Width="300" />
|
|
|
|
|
<ColumnDefinition Width="120" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
2026-03-19 16:41:35 +01:00
|
|
|
Text="{x:Bind domain:Translator.SettingsSignatureAndEncryption_NameColumn, Mode=OneTime}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
2026-03-19 16:41:35 +01:00
|
|
|
Text="{x:Bind domain:Translator.SettingsSignatureAndEncryption_ExpiresColumn, Mode=OneTime}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="3"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
2026-03-19 16:41:35 +01:00
|
|
|
Text="{x:Bind domain:Translator.SettingsSignatureAndEncryption_ThumbprintColumn, Mode=OneTime}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
</Grid>
|
|
|
|
|
</ListView.Header>
|
|
|
|
|
<ListView.ItemTemplate>
|
2026-03-27 12:57:44 +01:00
|
|
|
<DataTemplate x:DataType="crypt:X509Certificate2">
|
2025-11-23 20:56:57 +01:00
|
|
|
<Grid ColumnSpacing="16">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="0" />
|
|
|
|
|
<ColumnDefinition Width="300" />
|
|
|
|
|
<ColumnDefinition Width="120" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
2026-03-27 14:45:36 +01:00
|
|
|
<TextBlock Grid.Column="1" Text="{x:Bind Subject}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
FontSize="10"
|
|
|
|
|
Foreground="Gray"
|
2026-03-27 14:45:36 +01:00
|
|
|
Text="{x:Bind NotAfter}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="3"
|
|
|
|
|
FontSize="10"
|
|
|
|
|
Foreground="Gray"
|
2026-03-27 14:45:36 +01:00
|
|
|
Text="{x:Bind Thumbprint}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
|
|
|
|
|
<ListView.ItemContainerStyle>
|
|
|
|
|
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
|
|
|
</Style>
|
|
|
|
|
</ListView.ItemContainerStyle>
|
|
|
|
|
</ListView>
|
|
|
|
|
</controls:SettingsCard>
|
|
|
|
|
<controls:SettingsCard>
|
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="12">
|
|
|
|
|
<Button Command="{x:Bind ViewModel.RemovePersonalCertificatesCommand}" Content="{x:Bind domain:Translator.Buttons_Remove}" />
|
|
|
|
|
<Button Command="{x:Bind ViewModel.ExportPersonalCertificatesCommand}" Content="{x:Bind domain:Translator.Buttons_Export}" />
|
|
|
|
|
<Button Command="{x:Bind ViewModel.ImportPersonalCertificatesCommand}" Content="{x:Bind domain:Translator.Buttons_Import}" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</controls:SettingsCard>
|
|
|
|
|
</controls:SettingsExpander.Items>
|
|
|
|
|
</controls:SettingsExpander>
|
|
|
|
|
<controls:SettingsExpander
|
2026-03-19 16:41:35 +01:00
|
|
|
Description="{x:Bind domain:Translator.SettingsSignatureAndEncryption_RecipientCertificatesDescription, Mode=OneTime}"
|
|
|
|
|
Header="{x:Bind domain:Translator.SettingsSignatureAndEncryption_RecipientCertificatesHeader, Mode=OneTime}"
|
2025-11-23 20:56:57 +01:00
|
|
|
IsExpanded="False">
|
|
|
|
|
<controls:SettingsExpander.Items>
|
|
|
|
|
<!--<StackPanel Padding="12" Spacing="12">-->
|
|
|
|
|
|
|
|
|
|
<!--TODO: Not working
|
|
|
|
|
<TextBlock Visibility="{Binding ViewModel.RecipientCertificatesEmpty, Mode=OneWay}">
|
|
|
|
|
<Run Text="There are no items." />
|
|
|
|
|
</TextBlock>-->
|
|
|
|
|
|
|
|
|
|
<controls:SettingsCard>
|
|
|
|
|
<ListView
|
|
|
|
|
x:Name="RecipientCertList"
|
|
|
|
|
Height="180"
|
|
|
|
|
ItemsSource="{x:Bind ViewModel.RecipientCertificates, Mode=OneWay}"
|
|
|
|
|
SelectionChanged="RecipientCertList_SelectionChanged"
|
|
|
|
|
SelectionMode="Multiple">
|
|
|
|
|
<ListView.Header>
|
|
|
|
|
<Grid Padding="16,12" ColumnSpacing="16">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="26" />
|
|
|
|
|
<ColumnDefinition Width="300" />
|
|
|
|
|
<ColumnDefinition Width="120" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
2026-03-19 16:41:35 +01:00
|
|
|
Text="{x:Bind domain:Translator.SettingsSignatureAndEncryption_NameColumn, Mode=OneTime}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
2026-03-19 16:41:35 +01:00
|
|
|
Text="{x:Bind domain:Translator.SettingsSignatureAndEncryption_ExpiresColumn, Mode=OneTime}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="3"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
2026-03-19 16:41:35 +01:00
|
|
|
Text="{x:Bind domain:Translator.SettingsSignatureAndEncryption_ThumbprintColumn, Mode=OneTime}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
</Grid>
|
|
|
|
|
</ListView.Header>
|
|
|
|
|
<ListView.ItemTemplate>
|
2026-03-27 12:57:44 +01:00
|
|
|
<DataTemplate x:DataType="crypt:X509Certificate2">
|
2025-11-23 20:56:57 +01:00
|
|
|
<Grid ColumnSpacing="16">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="0" />
|
|
|
|
|
<ColumnDefinition Width="300" />
|
|
|
|
|
<ColumnDefinition Width="120" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
2026-03-27 14:45:36 +01:00
|
|
|
<TextBlock Grid.Column="1" Text="{x:Bind Subject}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
FontSize="10"
|
|
|
|
|
Foreground="Gray"
|
2026-03-27 14:45:36 +01:00
|
|
|
Text="{x:Bind NotAfter}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="3"
|
|
|
|
|
FontSize="10"
|
|
|
|
|
Foreground="Gray"
|
2026-03-27 14:45:36 +01:00
|
|
|
Text="{x:Bind Thumbprint}" />
|
2025-11-23 20:56:57 +01:00
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
|
|
|
|
|
<ListView.ItemContainerStyle>
|
|
|
|
|
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
|
|
|
</Style>
|
|
|
|
|
</ListView.ItemContainerStyle>
|
|
|
|
|
</ListView>
|
|
|
|
|
</controls:SettingsCard>
|
|
|
|
|
<controls:SettingsCard>
|
|
|
|
|
<StackPanel
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Spacing="12">
|
|
|
|
|
<Button Command="{x:Bind ViewModel.RemoveRecipientCertificatesCommand}" Content="{x:Bind domain:Translator.Buttons_Remove}" />
|
|
|
|
|
<Button Command="{x:Bind ViewModel.ExportRecipientCertificatesCommand}" Content="{x:Bind domain:Translator.Buttons_Export}" />
|
|
|
|
|
<Button Command="{x:Bind ViewModel.ImportRecipientCertificatesCommand}" Content="{x:Bind domain:Translator.Buttons_Import}" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</controls:SettingsCard>
|
|
|
|
|
</controls:SettingsExpander.Items>
|
|
|
|
|
</controls:SettingsExpander>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
</abstract:SignatureAndEncryptionPageAbstract>
|