Browse Source
Disable commands when Textbox is on password textbox mode.
pull/4547/head
Jumar Macato
6 years ago
No known key found for this signature in database
GPG Key ID: B19884DAC3A5BF3F
1 changed files with
3 additions and
3 deletions
-
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; |
|
|
|
} |
|
|
|
|
|
|
|
|