I\'m facing the same issue reported in these questions:
Button Command CanExecute not called when property changed
How can I force a textbox change to enable
While the "PropertyChanged" events are automatically marshalled, the call to CommandManager.InvalidateRequerySuggested() is not.
So to fix the issue just ensure the call is made on the Dispatcher thread as follows:
private void DataContext_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case "Ready":
var d = Application.Current.Dispatcher;
if (d.CheckAccess())
CommandManager.InvalidateRequerySuggested();
else
d.BeginInvoke((Action)(() => { CommandManager.InvalidateRequerySuggested(); }));
break;
}
}
Be careful when relying on property changes that are triggered by asynchronous tasks.
I hope this can help some of you in saving some days of work...