/// <summary> /// Starts the dispatcher on the main thread. /// </summary> /// <param name="thread">The thread.</param> /// <remarks> /// If the method has already been called previously, this new call will silently fail. /// </remarks> internal static void Run(Thread thread) { if (s_mainThreadDispather != null) { return; } s_mainThreadDispather = ThreadDispatcher.FromThread(thread) ?? ThreadDispatcher.CurrentDispatcher; s_oneSecondTimer = new DispatcherTimer(TimeSpan.FromSeconds(1), DispatcherPriority.Background, OneSecondTickTimer_Tick, s_mainThreadDispather); }