mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 07:30:15 -04:00

Dependencies finally installed Removal of useless code Big cleanup in XAML styles (override colors the correct way)
65 lines
4.3 KiB
XML
65 lines
4.3 KiB
XML
<UserControl x:Name="UserControl"
|
|
x:Class="ModernKeePass.Views.UserControls.SetCredentialsUserControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
|
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
|
xmlns:converters="using:ModernKeePass.Converters"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<converters:ProgressBarLegalValuesConverter x:Key="ProgressBarLegalValuesConverter"/>
|
|
<converters:DoubleToSolidColorBrushConverter x:Key="DoubleToSolidColorBrushConverter"/>
|
|
<converters:DiscreteIntToSolidColorBrushConverter x:Key="DiscreteIntToSolidColorBrushConverter"/>
|
|
<converters:EmptyStringToVisibilityConverter x:Key="EmptyStringToVisibilityConverter"/>
|
|
</UserControl.Resources>
|
|
<Grid x:Name="Grid" DataContext="{Binding Source={StaticResource Locator}, Path=SetCredentials}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="50" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<CheckBox Grid.Row="0" Grid.Column="0" IsChecked="{Binding HasPassword, Mode=TwoWay}" />
|
|
<PasswordBox Grid.Row="0" Grid.Column="1" x:Uid="CompositeKeyPassword" Password="{Binding Password, Mode=TwoWay}" Height="30" IsPasswordRevealButtonEnabled="True" BorderBrush="{Binding StatusType, Converter={StaticResource DiscreteIntToSolidColorBrushConverter}}">
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:EventTriggerBehavior EventName="GotFocus">
|
|
<core:ChangePropertyAction TargetObject="{Binding}" PropertyName="HasPassword" Value="True" />
|
|
</core:EventTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
</PasswordBox>
|
|
<PasswordBox Grid.Row="1" Grid.Column="1" x:Uid="CompositeKeyPassword" Password="{Binding ConfirmPassword, Mode=TwoWay}" Height="30" IsPasswordRevealButtonEnabled="True" BorderBrush="{Binding StatusType, Converter={StaticResource DiscreteIntToSolidColorBrushConverter}}" />
|
|
<ProgressBar Grid.Row="1" Grid.Column="1"
|
|
Maximum="128" VerticalAlignment="Bottom"
|
|
Value="{Binding PasswordComplexityIndicator, ConverterParameter=0\,128, Converter={StaticResource ProgressBarLegalValuesConverter}}"
|
|
Foreground="{Binding PasswordComplexityIndicator, ConverterParameter=128, Converter={StaticResource DoubleToSolidColorBrushConverter}}"/>
|
|
<CheckBox Grid.Row="2" Grid.Column="0" IsChecked="{Binding HasKeyFile, Mode=TwoWay}" />
|
|
<HyperlinkButton Grid.Row="2" Grid.Column="1" Margin="-15,0,0,0"
|
|
Content="{Binding KeyFileText}"
|
|
IsEnabled="{Binding HasKeyFile}"
|
|
Click="KeyFileButton_Click" />
|
|
<HyperlinkButton Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right"
|
|
IsEnabled="{Binding HasKeyFile}"
|
|
Click="CreateKeyFileButton_Click">
|
|
<SymbolIcon Symbol="Add">
|
|
<ToolTipService.ToolTip>
|
|
<ToolTip x:Uid="CompositeKeyNewKeyFileTooltip" />
|
|
</ToolTipService.ToolTip>
|
|
</SymbolIcon>
|
|
</HyperlinkButton>
|
|
<Button Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3"
|
|
Command="{Binding GenerateCredentialsCommand}"
|
|
Content="{Binding ButtonLabel, ElementName=UserControl}" />
|
|
<TextBlock Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="4" Height="Auto" FontSize="14" FontWeight="Light"
|
|
Text="{Binding Status}"
|
|
Foreground="{Binding StatusType, Converter={StaticResource DiscreteIntToSolidColorBrushConverter}}"
|
|
Visibility="{Binding Status, Converter={StaticResource EmptyStringToVisibilityConverter}}" />
|
|
</Grid>
|
|
</UserControl>
|