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

SetCredentials user controls now uses PasswordGenerationBox user control Some layout improvements in EntryDetailsPage WIP Clipboard suspend issues
45 lines
1.6 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|