microsoft / microsoft/microsoft-ui-xaml

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

Open
#10,396 0 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-XamlWindow feature proposal
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

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 https://github.com/microsoft/WindowsAppSDK/discussions/3680.

Open Questions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Microsoft.UI.Xaml.Window construction API and compare the requested owner WindowId behavior with AppWindow.Create(). Resolve the open ownership and constructor questions, then add coverage for creating a modal or dialog window with an owner. Done means ownership works without SetWindowLongPtr(GWL_HWNDPARENT).

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.