/// <summary>
/// Checks whether the current thread is the thread that the dispatcher is associated with.
/// </summary>
/// <returns>True if it is on the thread that the Dispatcher is associated with; otherwise false.</returns>
private bool IsInDispatcherThread()
{
#if NICENIS_UWP
return(TheWindow.Current.Dispatcher.HasThreadAccess);
#else
return(_dispatcher.CheckAccess());
#endif
}