Skip to content

Proposal: Set owner for Microsoft.UI.Xaml.Window #10396

@whiskhub

Description

@whiskhub

Summary

Allow to set an owner window for a Microsoft.UI.Xaml.Window by providing an owner WindowId, analog to AppWindow.Create() functionality.

Rationale

  • Allows to create modal/dialog windows in WinUI 3
  • Ensures feature parity with traditional Win32 window and AppWindow behavior
  • Ensures feature parity with other UI frameworks like WPF
  • Avoid use of the discouraged SetWindowLongPtr(GWL_HWNDPARENT) API

Scope

Capability Priority
Allow to set owner window for Microsoft.UI.Xaml.Window during construction Must

Important Notes

Example API

public Window();
public Window(WindowId ownerWindowId);

Also see microsoft/WindowsAppSDK#3680.

Open Questions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions