DispatcherQueueController Class

Definition

Manages the lifetime of a DispatcherQueue. Provides methods to create and shutdown the DispatcherQueue.

Equivalent WinUI class: Microsoft.System.DispatcherQueueController.

public ref class DispatcherQueueController sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DispatcherQueueController final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DispatcherQueueController
Public NotInheritable Class DispatcherQueueController
Inheritance
DispatcherQueueController
Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Remarks

Object and Thread Lifetime

DispatcherQueueController and its associated DispatcherQueue will be kept alive while the event loop is running. When Shutdown is completed, the loop is terminated and the dedicated thread will unwind. However, DispacherQueueController and the associated DispatcherQueue object can outlive thread’s lifetime and will be disposed when all their references are released.

Properties

DispatcherQueue

Gets the DispatcherQueue associated with this DispatcherQueueController.

Equivalent WinUI property: Microsoft.System.DispatcherQueueController.DispatcherQueue.

Methods

CreateOnDedicatedThread()

Creates a DispatcherQueue that you can use to run tasks on a dedicated thread.

Equivalent WinUI method: Microsoft.System.DispatcherQueueController.CreateOnDedicatedThread.

ShutdownQueueAsync()

Stops the DispatcherQueue associated with this DispatcherQueueController. Shuts down the thread if the DispatcherQueueController was created by CreateOnDedicatedThread.

Equivalent WinUI method: Microsoft.System.DispatcherQueueController.ShutdownQueueAsync.

Applies to

See also