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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MscrmTools are you ok with this pattern? When attempting to support rendering plugins in darkmode, I was running to an issue in which we would call
CustomTheme.Instance.ApplyTheme(this)
before the Plugin had a chance to render. This meant that the main window of plugins wouldn't get themed.Adding this statement - where we call
ApplyTheme
after a set amount of time - giving the plugin time to render it's WinForm - allowed the plugin to render in dark mode.For example, I tested with Sql4CDS and got this result:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if waiting a specific amount of time is the best way to handle this (even if I have no other idea for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I agree it's hacky. The problem is - I don't see any method in the IPlugin interface that is like "PluginFinishedLoading". I think that would be an optimal solution. Each plug-in could load, and only once it's ready let xrm toolbox know. The only problem is adding a new method and then getting all plug-ins to implement the new method would be a nightmare.