Skip to content

Commit

Permalink
Ensure the task yields. (#2591)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbritch authored Oct 30, 2024
1 parent 12b1061 commit 0056256
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/platform-integration/native-embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 0056256

Please sign in to comment.