🕓 5 MIN A car giant’s strategic …
Dual screen, Split-screen, or Fullscreen, whichever describes your workspace, we live in a time of heightened productivity and seamless multitasking. So, shouldn’t your app’s UI extend beyond a single window and let users interact with multiple components simultaneously without the need to toggle back and forth?
The short answer is yes, though the use case is much more evident for desktop users than mobile ones. Thankfully, if you’re an Uno Platform developer, the latest release introduces multi-window support for Windows, macOS, and Linux, so you can create richer, more engaging applications that can effectively multitask and handle complex workflows.
In this blog, we’ll explore the new multi-windowing feature, walk through its implementation, and share practical examples to help you integrate it into your Uno Platform projects.
Multi-window support allows applications to operate in more than one window at the same time. This feature is vital for desktop environments where users benefit from interacting with multiple datasets or interfaces concurrently.
Multi-window capabilities are built into the Uno Platform by leveraging native operating system APIs, ensuring that additional windows perform as native ones on each platform. It allows for multiple windows to run simultaneously on the same UI thread, which simplifies communication between windows without the need for synchronization or dispatchers.
This means that each window can have its own set of resources and be independently managed. The entire system is rendered using Skia, ensuring a native appearance and consistent text presentation across all application content, complete with expected features.
This approach allows for a more scalable application design and can be crucial for applications that need to display a significant amount of independent data or interfaces simultaneously.
Multi-window support allows users to handle multiple documents or views simultaneously, significantly reducing the need for switching contexts.
By providing tailored window behaviors, applications can offer more dynamic and immersive user experiences.
The ability to customize window configurations enables applications to adapt seamlessly to various user scenarios, from professional environments to more casual settings.
It also might prevent your users from feeling like this:
Developers can quickly spawn new windows using the Microsoft.UI.Xaml.Window class, which behaves similarly across platforms thanks to Uno’s consistent API surface. This allows for the straightforward instantiation of new windows with minimal overhead.
For applications requiring specialized window behaviors and unique layouts or those who prefer working directly with XAML, Uno Platform accommodates this by creating custom window types. By inheriting from the Window class, developers can define their own window logic and UI in XAML with supporting code-behind, harnessing the full power of XAML styling and templating.
Each custom window utilizes a `.xaml` file along with a corresponding `.xaml.cs` code-behind file, containing both the UI elements and the logic required for operations such as incrementing window counters and generating dynamic background colors. This approach enables developers to easily craft and showcase customized UIs within their windows.
The AppWindow
property offers advanced customization options, including window presentation – where developers can easily minimize or maximize the window, keep it on top of other windows, or switch it to full-screen mode.
To create a multi-window setup, start by creating a new window instance, configuring its UI, and setting the UI to the window’s content property. The window is then made visible through an activation method.
Here’s a straightforward example of how easily multi-window can be implemented with Uno.
var newWindow = new Window();
newWindow.Content = new MainPage();
newWindow.Activate();
TODO Minimize and Maximize via OverlappedPresenter
e.g. ((OverlappedPresenter)AppWindow.Presenter).Maximize())
Here is an example that toggles the application’s main window into fullscreen mode.
var app = Application.Current as App;
App.MainWindow.AppWindow.SetPresenter(Microsoft.UI.Windowing.AppWindowPresenterKind.Overlapped);
The window title feature exemplifies simple property settings, such as setting `window.title` to a text string, which can also be data-bound to other UI elements like a text box. This enables two-way data binding, allowing changes in the text box to be reflected in the window’s title bar.
If you haven’t already, install the Uno Platform extensions, then start by exploring our samples and tutorials to get hands-on experience.
And don’t forget to join the Uno Platform community.
Uno Platform
360 rue Saint-Jacques, suite G101,
Montréal, Québec, Canada
H2Y 1P5
USA/CANADA toll free: +1-877-237-0471
International: +1-514-312-6958
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Uno Platform 5.2 LIVE Webinar – Today at 3 PM EST – Watch