public class test1
{
public test1()
{
var m3 = typeof(test1).GetEvents()[0];
var z3 = typeof(test1).GetMethod(nameof(func1), BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
var x3 = z3.CreateDelegate(typeof(EventHandler), this);
public static async void UIInvoke(Task action)
{
if (uiThreadId == Environment.CurrentManagedThreadId)
{
await action;
}
else
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() => { action.Wait(); }));
}
}
public static async void UIInvoke(Action action)
{
if (uiThreadId == Environment.CurrentManagedThreadId)
{
action();
}
else
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(action));
}
}
}
//テスト用モデルクラス
public class testmodel : INotifyPropertyChanged, IRaisePropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void RaiseNotify(PropertyChangedEventArgs args)
{
Debug.WriteLine($"Update:{Environment.CurrentManagedThreadId}");
PropertyChanged?.Invoke(this, args);
}