zhaw-dnet2/Tasks/Lab6/UWPClient/PageExtension.cs

14 lines
330 B
C#
Raw Normal View History

2024-06-06 03:10:10 +00:00
using System;
using Windows.UI.Xaml.Controls;
namespace UWPClient
{
public static class PageExtension
{
public static async void InvokeIfRequired(this Page page, Action action)
{
await page.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () => action());
}
}
}