Files
modernkeepass/ModernKeePass/Views/UserControls/PasswordGenerationBox.xaml.cs
Geoffroy BONNEVILLE 3d436c56fa Password generation button with display toggle and indicator is now a user control
SetCredentials user controls now uses PasswordGenerationBox user control
Some layout improvements in EntryDetailsPage
WIP Clipboard suspend issues
2020-05-25 19:23:32 +02:00

45 lines
1.6 KiB
C#

using Windows.UI.Xaml;
using ModernKeePass.ViewModels;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
namespace ModernKeePass.Views.UserControls
{
public sealed partial class PasswordGenerationBox
{
public string Password
{
get { return (string)GetValue(PasswordProperty); }
set { SetValue(PasswordProperty, value); }
}
public static readonly DependencyProperty PasswordProperty =
DependencyProperty.Register(
nameof(Password),
typeof(string),
typeof(PasswordGenerationBox),
new PropertyMetadata(string.Empty, (o, args) =>
{
var passwordGenerationBox = o as PasswordGenerationBox;
var vm = passwordGenerationBox?.StackPanel.DataContext as PasswordGenerationBoxControlVm;
if (vm != null) vm.Password = args.NewValue.ToString();
}));
public string PlaceholderText
{
get { return (string)GetValue(PlaceholderTextProperty); }
set { SetValue(PlaceholderTextProperty, value); }
}
public static readonly DependencyProperty PlaceholderTextProperty =
DependencyProperty.Register(
nameof(PlaceholderText),
typeof(string),
typeof(PasswordGenerationBox),
new PropertyMetadata(string.Empty, (o, args) => { }));
public PasswordGenerationBox()
{
InitializeComponent();
}
}
}