Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi Window Support #2811

Merged
merged 34 commits into from
Nov 2, 2021
Merged

Multi Window Support #2811

merged 34 commits into from
Nov 2, 2021

Conversation

Redth
Copy link
Member

@Redth Redth commented Oct 1, 2021

Description

This PR adds support for opening multiple windows on all the platforms that support them:

  • Android
  • iOS on iPad
  • Mac Catalyst
  • Windows

API Usage

The usage of the API is pretty simple:

var secondWindow = new Window {
    Page = new MySecondPage {
        // ...
    }
};

Application.Current.OpenWindow(secondWindow);

API Implementation

This API is implemented in the ApplicationHandler and uses a "OpenWindow" command with OpenWindowRequest arguments to hold state and launch options.

When a window is closed/backgrounded, there is a new Backgrounding event on Window that can be used to persist any string state to an object that the OS will preserve until it is time to resume that window. An example of state would be maybe a document path that the user has opened.

Then at some point in the future, when the user selects that window to resume, the state is provided via the IActivationState in CreateWindow. This state can the be read and used to re-load that document (if it is still available).

@Redth Redth added the legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) label Oct 1, 2021
@mattleibow
Copy link
Member

muilti-window

@Redth Redth added this to the 6.0.101-preview.10 milestone Oct 25, 2021
@mattleibow mattleibow changed the base branch from main to release/6.0.1xx-preview10 October 26, 2021 23:10
@mattleibow mattleibow marked this pull request as ready for review October 26, 2021 23:11
@Redth Redth requested a review from Eilon as a code owner November 1, 2021 19:00
@mattleibow mattleibow changed the base branch from release/6.0.1xx-preview10 to main November 1, 2021 19:03
@Redth Redth merged commit 6743036 into main Nov 2, 2021
@Redth Redth deleted the dev-multi-window branch November 2, 2021 13:57
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@Eilon Eilon added the t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK) label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants