liveBook · Manning

Scene

As explained in .NET MAUI in Action

A Scene is an iOS or Mac Catalyst running instance of an application that manages its windows and user interface.

A Scene is a running instance of an iOS or Mac Catalyst application. It manages the app’s windows and user interface, making it central to multiwindow support. section 10.3.3

In a .NET MAUI app, multiwindow support on iOS and Mac Catalyst requires a SceneDelegate in each platform folder and an info.plist declaration enabling multiple scenes. section 10.3.3

Opening an About window

Create a Window containing AboutPage, assign its title and dimensions, and pass it to Application.Current.OpenWindow. The SceneDelegate and scene manifest allow this additional window to operate on iOS and Mac Catalyst. section 10.3.3

Listing 10.22 The SceneDelegate.cs file
using Foundation;
 
namespace MauiStockTake.UI.Platforms.[iOS/MacCatalyst];   #1
 
[Register("SceneDelegate")]
public class SceneDelegate : MauiUISceneDelegate
{
}

Use the SceneDelegate listing to see the minimal MauiUISceneDelegate declaration and platform-specific namespace. section 10.3.3

Listing 10.23 The multiwindow key to add to info.plist
<key>UIApplicationSceneManifest</key>
<dict>
  <key>UIApplicationSupportsMultipleScenes</key>
  <true/>
  <key>UISceneConfigurations</key>
  <dict>
    <key>UIWindowSceneSessionRoleApplication</key>
    <array>
      <dict>
        <key>UISceneConfigurationName</key>
        <string>__MAUI_DEFAULT_SCENE_CONFIGURATION__</string>
        <key>UISceneDelegateClassName</key>
        <string>SceneDelegate</string>
      </dict>
    </array>
  </dict>
</dict>

Use the info.plist listing to inspect the keys that enable multiple scenes and associate the application configuration with SceneDelegate. section 10.3.3

How .NET MAUI in Action covers it

How deep it goes
Explains the role of a Scene and gives configuration steps, but does not describe its runtime lifecycle internals.
Examples
Demonstrates opening an AboutPage in a new Window through a ReportViewModel command.
What it assumes
Assumes a .NET MAUI application with platform folders and an existing page that can be placed in a Window.
What you can do after
Operate/configure multiwindow support by adding SceneDelegate and the required info.plist scene manifest.
How it connects
Connects Scenes with SceneDelegate, Window, Application.Current.OpenWindow, and info.plist.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.