From 0ee11076386d87030830148fdf8bd95d75c39f99 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Sun, 16 Jul 2023 21:37:40 +0300 Subject: [PATCH] Make password box un-editable --- .../Views/Controls/RevealablePasswordBox.xaml | 6 +++--- .../Views/Controls/RevealablePasswordBox.xaml.cs | 15 +-------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/DiscordChatExporter.Gui/Views/Controls/RevealablePasswordBox.xaml b/DiscordChatExporter.Gui/Views/Controls/RevealablePasswordBox.xaml index 5ca0f8b6..f9ca6ad6 100644 --- a/DiscordChatExporter.Gui/Views/Controls/RevealablePasswordBox.xaml +++ b/DiscordChatExporter.Gui/Views/Controls/RevealablePasswordBox.xaml @@ -12,13 +12,13 @@ \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Views/Controls/RevealablePasswordBox.xaml.cs b/DiscordChatExporter.Gui/Views/Controls/RevealablePasswordBox.xaml.cs index efe8fb1c..13cc1a2d 100644 --- a/DiscordChatExporter.Gui/Views/Controls/RevealablePasswordBox.xaml.cs +++ b/DiscordChatExporter.Gui/Views/Controls/RevealablePasswordBox.xaml.cs @@ -8,17 +8,7 @@ public partial class RevealablePasswordBox nameof(Password), typeof(string), typeof(RevealablePasswordBox), - new FrameworkPropertyMetadata( - string.Empty, - FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, - (sender, args) => - { - var revealablePasswordBox = (RevealablePasswordBox)sender; - var password = (string)args.NewValue; - - revealablePasswordBox.PasswordBox.Password = password; - } - ) + new FrameworkPropertyMetadata(string.Empty, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault) ); public static readonly DependencyProperty IsRevealedProperty = DependencyProperty.Register( @@ -44,7 +34,4 @@ public partial class RevealablePasswordBox { InitializeComponent(); } - - private void PasswordBox_OnPasswordChanged(object sender, RoutedEventArgs args) => - Password = PasswordBox.Password; } \ No newline at end of file