dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

Need an option to know which window is currently active in a multiwindow app #24711

Open egvijayanand opened 1 month ago

egvijayanand commented 1 month ago

Description

Need an option, like IsActive, to find out which Window is currently active in a multiwindow app.

And it should dynamically get updated as soon as the Window change its state.

Public API Changes

var window = Application.Current?.Windows.FirstOrDefault(x => x.IsActive);

var page = await window?.Page?.DisplayAlert("Title", "Message", "OK");

Intended Use-Case

For example, this info is necessary to route dialogs on top of that window.

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.