Using Stylet
I'm using the default Stylet template with dotnet core 3.1. I simply added a property/method for reproducing the issue.
<TextBox Text="{Binding Username,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"
Width="100" Height="100"/>
<Button Command="{s:Action Do}">Foo</Button>
public class ShellViewModel : Screen
{
public string Username { get; set; }
public void Do() { }
public bool CanDo => !string.IsNullOrWhiteSpace(Username);
}
Breakpoint on CanDo
property is hit once and never hit again. Changing the value in the TextBox
, while calling set
, does not retrigger the CanDo
property.
I've also tried using backing fields with SetAndNotify
, to no avail:
public string Username { get => username; set => SetAndNotify(ref username, value, nameof(Username)); }