Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]MVVM Framework
  [Expand]ViewModels
  [Expand]Commands
  [Expand]Behaviors
  [Collapse]Services
    Getting Started
    Services in ViewModelBase descendants
    Services in POCO objects
    Services in custom ViewModels
    View creation mechanisms
   [Collapse]Predefined Set
    [Expand]Dialog Services
    [Expand]Message Box Services
    [Expand]Document Services
    [Expand]ViewInjectionService
    [Expand]Report Services
     NotificationService
     TaskbarButtonService
     ApplicationJumpListService
     DXSplashScreenService
     DispatcherService
     FrameNavigationService
     LayoutSerializationService
     FolderBrowserDialogService
     OpenFileDialogService
     SaveFileDialogService
     WizardService
     NotifyIconService
    How to create a Custom Service
  [Expand]DXBinding
  [Expand]MIF
   Converters
   ViewLocator
   Messenger
   Data Annotation Attributes
   LayoutTreeHelper
   Weak Event
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

DispatcherService

The DispatcherService is an IDispatcherService implementation that allows you to perform actions in a ViewModel using the Dispatcher.

Expanded Getting Started with DispatcherService

To perform an action in a ViewModel using the Dispatcher, use the DispatcherService. Add the service to the view's dxmvvm:Interaction.Behaviors.

Use any of the following approaches to access the defined DispatcherService from your ViewModel.

To perform the required actions, use the BeginInvoke method, as shown in the code snippet below.

The DispatcherService provides the following properties.

  • DispatcherPriority - gets or sets the DispatcherService's Dispatcher priority by which operations can be invoked by the Dispatcher.
  • Delay - gets or sets the amount of time (a TimeSpine object), to wait before invoking the DispatcherService's BeginInvoke method.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T226425.

Is this topic helpful?​​​​​​​