Click or drag to resize

BackgroundThreadWithDispatcher Class

A dedicated thread hosting an active dispatcher. The thread will be created as background thread, so it does not need to be shut down explicitly.
Inheritance Hierarchy
SystemObject
  TomsToolbox.WpfThreadWithDispatcher
    TomsToolbox.WpfBackgroundThreadWithDispatcher

Namespace: TomsToolbox.Wpf
Assembly: TomsToolbox.Wpf (in TomsToolbox.Wpf.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public class BackgroundThreadWithDispatcher : ThreadWithDispatcher

The BackgroundThreadWithDispatcher type exposes the following members.

Constructors
 NameDescription
Public methodBackgroundThreadWithDispatcher(String, ApartmentState) Initializes a new instance of the BackgroundThreadWithDispatcher class.
Public methodBackgroundThreadWithDispatcher(String, ApartmentState, ThreadPriority) Initializes a new instance of the BackgroundThreadWithDispatcher class.
Top
Properties
 NameDescription
Public propertyDispatcher Gets the dispatcher of the thread.
(Inherited from ThreadWithDispatcher)
Public propertyTaskScheduler Gets the task scheduler associated with the Dispatcher
(Inherited from ThreadWithDispatcher)
Top
Methods
 NameDescription
Public methodAbortObsolete.
Aborts this instance.
(Inherited from ThreadWithDispatcher)
Public methodBeginInvoke(Action) Invokes the specified method asynchronously in the dispatcher thread.
(Inherited from ThreadWithDispatcher)
Public methodBeginInvoke(DispatcherPriority, Action) Invokes the specified method asynchronously in the dispatcher thread.
(Inherited from ThreadWithDispatcher)
Public methodBeginShutdown Initiates shutdown of the Dispatcher asynchronously.
(Inherited from ThreadWithDispatcher)
Public methodCheckAccess Determines whether the calling thread is the thread associated with this Dispatcher.
(Inherited from ThreadWithDispatcher)
Public methodInvoke(Action) Invokes the specified method in the dispatcher thread.
(Inherited from ThreadWithDispatcher)
Public methodInvokeT(FuncT) Invokes the specified method in the dispatcher thread.
(Inherited from ThreadWithDispatcher)
Public methodJoin Blocks the calling thread until the Dispatcher terminates.
(Inherited from ThreadWithDispatcher)
Public methodJoin(TimeSpan) Blocks the calling thread until the Dispatcher terminates.
(Inherited from ThreadWithDispatcher)
Public methodVerifyAccess Determines whether the calling thread has access to this Dispatcher.
(Inherited from ThreadWithDispatcher)
Top
Events
 NameDescription
Public eventTerminated Occurs when the dispatcher is terminated.
(Inherited from ThreadWithDispatcher)
Top
Extension Methods
 NameDescription
Public Extension MethodSafeCastT Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions)
Top
Remarks
Use this thread to dispatch or serialize background operations, or to host COM objects that don't have a free threaded marshaller. A background thread will be killed by the system when the application terminates, so do not host objects in a background thread that need cleanup!
See Also