This repository was archived by the owner on Sep 4, 2024. It is now read-only.
Add an optional MessageDialog.RootWindow override#940
Open
sevoku wants to merge 2 commits into
Open
Conversation
Allows the client to supply a custom dynamic RootWindow using MessageDialogDefaults.DefaultRootWindowOverride
Therzok
reviewed
May 29, 2019
| { | ||
| get { | ||
| if (Toolkit.CurrentEngine.Defaults.MessageDialog.DefaultRootWindowOverride != null) | ||
| return Toolkit.CurrentEngine.Defaults.MessageDialog.DefaultRootWindowOverride() ?? rootWindow; |
Contributor
There was a problem hiding this comment.
The API here is weird. Why do we want this as a Func<WindowFrame>?
Member
Author
There was a problem hiding this comment.
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).
slluis
approved these changes
May 29, 2019
Therzok
approved these changes
May 29, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.