The DevExpress.Mvvm.IDispatcherService interface has been changed. Previously it had a single void method for executing actions.
C#public interface IDispatcherService {
void BeginInvoke(Action action);
}
Visual BasicPublic Interface IDispatcherService
Sub BeginInvoke(ByVal action As Action)
End Interface
We have wrapped the BeginInvoke method in Task and added an Invoke void method.
C#public interface IDispatcherService {
Task BeginInvoke(Action action);
void Invoke(Action action);
}
Visual BasicPublic Interface IDispatcherService
Function BeginInvoke(ByVal action As Action) As Task
Sub Invoke(ByVal action As Action)
End Interface
This change allows you to use the DispatcherService to perform actions in a ViewModel asynchronously using the await operator. See the example below:
C#using DevExpress.Mvvm;
await DispatcherService.BeginInvoke(() => {
// action
});
Visual BasicImports DevExpress.Mvvm
Await DispatcherService.BeginInvoke(Sub()
'...
End Sub)
Use the DispatcherService.Invoke void method to execute actions synchronously.