Howdy! 👋
It is almost 2022 and .NET MAUI team non-stop delivers new features for the upcoming MAUI year!
.NET MAUI Preview 11 was silently released (release notes) with Multi-Window support! Let's see how to add this cool feature to your application.
Run
dotnet workload update
to update to the latest .NET MAUI Preview version. We need at least Preview 11.To open the window we need just 2 lines of code: the first line initializes a new window with a Page inside, and the second line just opens the window:
Closing the window is even simpler - we need just 1 line of code.
To close the current window call the next command:
To close a specific window pass the instance of that window to the method:
Platform configurations
iOS/MacCatalyst
Create and register
SceneDelegate
Open
Info.plist
and add the next content to the end of the file:
The full code can be found on GitHub.
Happy holidays! 🎄🎁