public void ShowScreenRefresher()
{
Task.Factory.StartNew(
() =>
{
if (!this.IsVisible)
{
this.Dispatcher.Invoke(this.Show);
}
const string ThreadName = "ScreenRefresherAnimationThread";
if (string.IsNullOrWhiteSpace(Thread.CurrentThread.Name) || Thread.CurrentThread.Name != ThreadName)
{
Thread.CurrentThread.Name = ThreadName;
}
this.Dispatcher.BeginInvoke(new Action(this.eventHook.Start));
this.StartAnimation(this.cycleColors.First());
},
CancellationToken.None,
TaskCreationOptions.LongRunning,
TaskScheduler.Default);
}