Dark Mode Styling#1325
Conversation
| Task.Factory.StartNew(() => | ||
| { | ||
| System.Threading.Thread.Sleep(TimeSpan.FromSeconds(5)); | ||
|
|
||
| this.Invoke((MethodInvoker)delegate | ||
| { | ||
| CustomTheme.Instance.ApplyTheme(this); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
@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.
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.
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.
| this.checkForUpdateToolStripMenuItem.Text = "Check for update"; | ||
| this.checkForUpdateToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdateToolStripMenuItem_Click); | ||
| // | ||
| // darkMode |
There was a problem hiding this comment.
@MscrmTools - I see you were down this road already, I updated the darkmode button. Do you think this should be the one and only way to trigger darkmode for plugins?
|
Any update on this? I know there was the question of plugin load handling and there have been many commits since which would need to be accounted for @MscrmTools @johnyenter-briars |
|
I must admit I abandoned this feature. |
If I synced this back up with master, would you take a look at it? |
|
I will do reviews for sure, just don't want to handle this myself |
No prob - thanks. This has recently re-entered my TODOs. I hope to take another crack at it in the next few weeks here. 👍 |
|
Thank you both! |


Dark Mode
Objective
Notes
Plugins To Support (I plan to test)