Browse Source
Merge pull request #4547 from AvaloniaUI/fixes/textbox-disable-commands-when-pwdbox
Fixes/textbox disable commands when pwdbox
debug/skia-sharp-vmem
danwalmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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; |
|
|
|
} |
|
|
|
|
|
|
|
|