Demonstrates how to open multiple independent native windows, each hosting a different Blazor component and HTML page
- Creating multiple windows sequentially from a single
InfiniFrameBlazorAppBuilder - Each window has its own root Blazor component (
Window1,Window2) and its ownindex.html - Opening the next window from the
WindowCreatedevent of the previous one - Coordinating close: when any window closes, all others are closed too
- Per-window HTML files (
window1.html,window2.html) and CSS
dotnet run --project examples/InfiniFrameExample.BlazorWebView.MultiWindowSample// Queue of windows to create
CreateWindows(appBuilder, new Queue<WindowCreationArgs>(new[] {
new WindowCreationArgs(typeof(Window1), "Window 1", new Uri("window1.html", UriKind.Relative)),
new WindowCreationArgs(typeof(Window2), "Window 2", new Uri("window2.html", UriKind.Relative))
}));
// Each window triggers the next via WindowCreated
InfiniFrameWindowBuilder.Create()
.SetTitle(args.Title)
.SetStartUrl(args.HtmlPath)
.RegisterWindowCreatedHandler(_ => Task.Run(() => CreateWindows(appBuilder, windowsToCreate)))
.RegisterWindowClosingHandler((_, _) => { CloseAllWindows(); return false; })
.Build();InfiniLore.InfiniFrame.BlazorWebViewInfiniLore.InfiniFrame.Blazor