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

Code cleanup in Lib WIP new VM for OpendatabaseControl WIP KDBX4 file save - still not working
45 lines
3.4 KiB
XML
45 lines
3.4 KiB
XML
<UserControl x:Name="UserControl"
|
|
x:Class="ModernKeePass.Controls.OpenDatabaseUserControl"
|
|
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:actions="using:ModernKeePass.Actions"
|
|
xmlns:converters="using:ModernKeePass.Converters"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="120"
|
|
d:DesignWidth="550" >
|
|
<UserControl.Resources>
|
|
<SolidColorBrush x:Key="ErrorColorBrush" Color="Red"/>
|
|
<converters:ProgressBarLegalValuesConverter x:Key="ProgressBarLegalValuesConverter"/>
|
|
<converters:DoubleToForegroungBrushComplexityConverter x:Key="DoubleToForegroungBrushComplexityConverter"/>
|
|
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
|
</UserControl.Resources>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="50" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<CheckBox x:Name="PasswordCheckBox" Grid.Row="0" Grid.Column="0" />
|
|
<PasswordBox Grid.Row="0" Grid.Column="1" x:Name="PasswordBox" Password="{Binding Password, ElementName=UserControl, Mode=TwoWay}" Height="30" IsEnabled="{Binding IsChecked, ElementName=PasswordCheckBox}" IsPasswordRevealButtonEnabled="True" KeyDown="PasswordBox_KeyDown" PlaceholderText="Password" >
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:DataTriggerBehavior Binding="{Binding IsChecked, ElementName=PasswordCheckBox}" Value="True">
|
|
<actions:SetupFocusAction TargetObject="{Binding ElementName=PasswordBox}" />
|
|
</core:DataTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
</PasswordBox>
|
|
<ProgressBar Grid.Row="0" Grid.Column="1" Value="{Binding PasswordComplexityIndicator, ElementName=UserControl, ConverterParameter=0\,128, Converter={StaticResource ProgressBarLegalValuesConverter}}" Maximum="128" Width="500" VerticalAlignment="Bottom" Foreground="{Binding PasswordComplexityIndicator, ElementName=UserControl, ConverterParameter=128, Converter={StaticResource DoubleToForegroungBrushComplexityConverter}}" Visibility="{Binding CreateNew, ElementName=UserControl, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
<CheckBox x:Name="KeyFileCheckBox" Grid.Row="1" Grid.Column="0" />
|
|
<HyperlinkButton Grid.Row="1" Grid.Column="1" Margin="-15,0,0,0" Content="Select key file from disk..." IsEnabled="{Binding IsChecked, ElementName=KeyFileCheckBox}" Click="KeyFileButton_Click" />
|
|
<Button Grid.Column="0" Grid.Row="2" Content="OK" Click="OpenButton_OnClick" Background="{ThemeResource ListViewItemSelectedPointerOverBorderThemeBrush}" Foreground="{ThemeResource TextBoxBackgroundThemeBrush}" />
|
|
<TextBlock Grid.Column="1" Grid.Row="2" x:Name="StatusTextBlock" Height="28" FontSize="14" FontWeight="Light" TextWrapping="WrapWholeWords" HorizontalAlignment="Right" />
|
|
</Grid>
|
|
</UserControl>
|