DispatcherQueue DispatcherQueue DispatcherQueue DispatcherQueue Class

Definition

Manages a prioritized queue on which tasks execute in a serial fashion on a thread.

public : sealed class DispatcherQueue : IDispatcherQueue
struct winrt::Windows::System::DispatcherQueue : IDispatcherQueue
public sealed class DispatcherQueue : IDispatcherQueue
Public NotInheritable Class DispatcherQueue Implements IDispatcherQueue
Attributes

Windows 10 requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

All tasks dispatched to a queue execute on the same thread.

Methods

CreateTimer() CreateTimer() CreateTimer() CreateTimer()

Creates a DispatcherQueueTimer on the DispatcherQueue to execute a task periodically after a time interval has elapsed.

GetForCurrentThread() GetForCurrentThread() GetForCurrentThread() GetForCurrentThread()

Gets the DispatcherQueue associated with the current thread.

TryEnqueue(DispatcherQueueHandler) TryEnqueue(DispatcherQueueHandler) TryEnqueue(DispatcherQueueHandler) TryEnqueue(DispatcherQueueHandler)

Adds a task to the DispatcherQueue which will be executed on the thread associated with the DispatcherQueue.

TryEnqueue(DispatcherQueuePriority, DispatcherQueueHandler) TryEnqueue(DispatcherQueuePriority, DispatcherQueueHandler) TryEnqueue(DispatcherQueuePriority, DispatcherQueueHandler) TryEnqueue(DispatcherQueuePriority, DispatcherQueueHandler)

Adds a task to the DispatcherQueue which will be executed on the thread associated with the DispatcherQueue.

Events

ShutdownCompleted ShutdownCompleted ShutdownCompleted ShutdownCompleted

Fires after the DispatcherQueue event loop stops which is the last step in the DispatcherQueue shutdown process.

ShutdownStarting ShutdownStarting ShutdownStarting ShutdownStarting

Fires before the dispatcher queue initiates an exit from its event loop.