Ejemplo n.º 1
0
        private static async Task PerformDispatcherSwitch(Dispatcher dispatcher)
        {
            Assert.True(dispatcher.CheckAccess());

            // Switch thread.
            await TaskMaster.AwaitBackgroundThread();

            Assert.False(dispatcher.CheckAccess());

            // Switch back to UI thread.
            await TaskMaster.AwaitThread(dispatcher);

            Assert.True(dispatcher.CheckAccess());
        }