This project has moved and is read-only. For the latest updates, please go here.

WAF and threading

Jan 14, 2010 at 5:45 PM

What about WAF and threading. I want to build an application that interacts with two web services, so I decided to use threading for data retrieval and processing.

How should I update ICommand on the user thread?

Should I always call RaiseCanExecuteChanged when a command status changes?



Jan 18, 2010 at 7:47 PM

Hello Stefan,

  1. I recommend you to synchronize back into the UI (Dispatcher) thread before updating the ICommand. You might use the BackgroundWorker class for the synchronization.
  2. Call the RaiseCanExecuteChanged method always when it might be possible that the command status has changed.

Best Regards,