Not sure what I'm doing wrong:
private at = "0";
public string AT
{
get
{
return aT;
}
set
{
aT = value;
this.RaiseAndSetIfChanged(ref aT, value);
}
}
Setting this on the ViewModel using AT = "Something"
, the Raise is called and the View is set initially. However, as the AT gets called continuously (at least one update per second), this does not update after the initial set (the original value of aT)
this.WhenAnyValue(x => x.ViewModel.AT).Subscribe(x => Debug.WriteLine("Change in AT:" + x)); // using this to debug
What seems to work for a while is this:
set
{
aT = value;
this.RaisePropertyChanged();
}
However, after successfully getting one value (aside from the initial set), it crashes! What am I doing wrong?
Edit:
This property is changed in an async event handler. The property is changed on every occasion when I breakpoint. This occurs around 1 per second:
private async void ValueChanged(Something sender, SomeArgs args)
{
//Computation code here
AT= string.Format("{0:0.0####}", ATOrigin);
// Property is set - I checked
// More code here
}