Ensure the task yields. (#2591)
This commit is contained in:
Родитель
12b1061b1d
Коммит
0056256b67
|
@ -887,8 +887,10 @@ public sealed partial class MainWindow : Microsoft.UI.Xaml.Window
|
|||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnRootLayoutLoaded(object? sender, RoutedEventArgs e)
|
||||
private async void OnRootLayoutLoaded(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
await Task.Yield();
|
||||
|
||||
// Ensure .NET MAUI app is built before creating .NET MAUI views
|
||||
var mauiApp = MyEmbeddedMauiApp.Shared;
|
||||
|
||||
|
@ -1095,8 +1097,10 @@ public sealed partial class MainWindow : Microsoft.UI.Xaml.Window
|
|||
_window ??= this;
|
||||
}
|
||||
|
||||
private void OnRootLayoutLoaded(object? sender, RoutedEventArgs e)
|
||||
private async void OnRootLayoutLoaded(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
await Task.Yield();
|
||||
|
||||
// Create MAUI embedded window context
|
||||
var context = WindowContext;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче