My label text isn't updating properly in my 3.5 WPF MVVM app. The do work part lasts long enough that you can see the waiting mouse pointer. All I ever see is "Parsed" in the label, which is Bound to InfoText. the Dispatcher and do work lines are in a Command's method. Ideas?
The code
Dispatcher.Invoke((Action<string>)SetInfoText, "Start Parsing");
//do work
Dispatcher.Invoke((Action<string>)SetInfoText, "Parsed");
private void SetInfoText(string text)
{
InfoText = text;
}
private string _infoText;
public string InfoText
{
get
{
return _infoText;
}
set
{
_infoText = value;
OnPropertyChanged("InfoText");
}
}