Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Add an optional MessageDialog.RootWindow override #940

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sevoku
Copy link
Member

@sevoku sevoku commented May 29, 2019

Allows the client to supply a custom dynamic RootWindow using MessageDialogDefaults.DefaultRootWindowOverride.

And adds some useful MessageDialog.Show* overloads.

NOTE: this is a quicj workaround to be less restricted to the static MessageService.RootWindow. The long term plan is to deprecate that property and let the toolkits decide which root window to use. But this need some more complex changes to the API.

Allows the client to supply a custom dynamic RootWindow
using MessageDialogDefaults.DefaultRootWindowOverride
@sevoku sevoku requested a review from slluis May 29, 2019 14:51
{
get {
if (Toolkit.CurrentEngine.Defaults.MessageDialog.DefaultRootWindowOverride != null)
return Toolkit.CurrentEngine.Defaults.MessageDialog.DefaultRootWindowOverride() ?? rootWindow;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API here is weird. Why do we want this as a Func<WindowFrame>?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that if you show some dialog and a message using the message service, you need either to call an override with a custom parent window or set the RootWindow accordingly (and then back). It becomes even worse if you have different main windows (like VS for Mac has a main Shell and a GetToCode dialog). This also becomes a real problem if you consume some external API which is using Xwt and doesn't know your code. It won't know about your windows structure and always use RootWindow (like the Android SDK Manager in VS for Mac).

Base automatically changed from master to main March 9, 2021 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants