What is the difference between the App, Window, and Page objects?
Short answer
App (Application) is the singleton root of the app and creates the initial Window. A Window represents an OS window/screen host and owns a navigation root (its Page). A Page is a single screen of content. Desktop platforms can open multiple Windows; mobile typically uses one.
Advertisement
AModel answer
App (Application) is the singleton root of the app and creates the initial Window. A Window represents an OS window/screen host and owns a navigation root (its Page). A Page is a single screen of content. Desktop platforms can open multiple Windows; mobile typically uses one. Application.Windows exposes all open windows.
public partial class App : Application
{
public App() => InitializeComponent();
protected override Window CreateWindow(IActivationState? state)
=> new Window(new AppShell()) { Title = "W3Teacher" };
}Real-world example
A desktop MAUI app opens a second Window for a detached document editor while keeping the main dashboard Window active.
Likely follow-ups
- How do you open a second window? | What is AppShell?
Related topics