static class exMethods { async public static void ThreadSafeUpdate(this System.Windows.Controls.Control @this, Action updateLogic) { await @this.Dispatcher.BeginInvoke(updateLogic); } }
this.ThreadSafeUpdate(() => this.Visibility = Visibility.Hidden);
Source: https://habr.com/ru/post/271781/
All Articles