Browse Source

Disable commands when Textbox is on password textbox mode.

pull/4547/head
Jumar Macato 6 years ago
parent
commit
517e860b27
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 6
      src/Avalonia.Controls/TextBox.cs

6
src/Avalonia.Controls/TextBox.cs

@ -456,9 +456,9 @@ namespace Avalonia.Controls
private void UpdateCommandStates()
{
var text = GetSelection();
var isNullOrEmpty = string.IsNullOrEmpty(text);
CanCopy = !isNullOrEmpty;
CanCut = !isNullOrEmpty && !IsReadOnly;
var isSelectionNullOrEmpty = string.IsNullOrEmpty(text);
CanCopy = !IsPasswordBox && !isSelectionNullOrEmpty;
CanCut = !IsPasswordBox && !isSelectionNullOrEmpty && !IsReadOnly;
CanPaste = !IsReadOnly;
}

Loading…
Cancel
Save