Skip to content

Cannot clear UnsafePassword in plaintext state by vm code #645

@JeremyWu917

Description

@JeremyWu917

Describe the bug
After binding UnsafePassword to hc:PasswordBox, the value of UnsafePassword cannot be cleared by backend code in plaintext state, but can be cleared by ClearButton in frontend. And in ciphertext state, everything is ok.

Expected behavior
The value should be cleared regardless of whether it is in plaintext or ciphertext state

Screenshots
issue_passwordbox_bug

Environment (please complete the following information):

  • .net: [NET 5.0]
  • IDE [VS2019 16.8.4]
  • HC Version [3.0.0]

Additional context
Here is the partial code

  • .XAML
    <hc:PasswordBox hc:InfoElement.Placeholder="请输入密码" IsSafeEnabled="False" ShowClearButton="True" ShowEyeButton="True" UnsafePassword="{Binding Password}" />
  • VM
    private string _Password;
    public string Password { get { return _Password; } set { _Password = value; this.RaisePropertyChanged(nameof(Password)); } }
    public DelegateCommand CancelCommand { get; set; } private void Cancel(object parameter) { Password = ""; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions