Hello,
I'm seeing an issue whereby when we set the theme in our application as follows:
ThemeManager
.CurrentTheme = theme;
where 'theme' is one of your preset themes - some of our controls seem to become unloaded. For example, combo boxes (both yours and standard WPF) would not show the popup (or popdown). When debugging I could see that the controls which were not responding have the property 'IsLoaded' set to false.
If the theme is set for the application, are you unloading controls in the background?
Thanks in advance.
We got the latest hotfix (version 10.2.20102.2139 - is that the right one?) and re-tested. We're still getting the same issue. I will try and cobble together an example which I can upload here.
That issue was fixed back in July (and was fixed in 9.1 and forward) so try getting the latest hotfix for 10.2 and retesting.
Thanks for your response again.. Unfortunately, I don't think it will be possible to split the app up and strip out the bits we need without doing some major fiddling and hopefully it won't come to that!
However, I've had a look at Snoop and gone through the visual tree. The going up the visual tree, the first thing that isn't loaded is a 'SplitPane' in the following:
XamDockManager -> AdornerDecorator -> Border -> DockPanel -> PART_Panel (DockManagerPanel) -> **SplitPane**
It seems as though it's the descendants of the PART_Panel which aren't loaded (or rather where IsLoaded is false) and it sounds like the issue you described with the xamDockManager. We're using version 10.2, which version were the problems you mentioned fixed in?
Reproducing this in a simple may be difficult. When I have seen this it has been related to having descendant elements that have hooked the Loaded event (which is a valid thing but as I mentioned the IsLoaded state seems to make some assumptions based on the event being hooked). So it might be easier to take the existing project, make a copy of it, remove the code behind that you can (in all likelihood the code isn't needed unless you have code that is creating/manipulating the ui), and then start to remove unnecessary elements. Even if you can't remove the elements, if you can get it to the point where that can be run and the problem is demonstrated we can take a look. Since this will be related to your real project you'll probably want to submit the project directtly to the support group rather than posting it here.
If you want to try and debug this in your actual app the first thing you may want to do is to use Snoop and walk up the visual tree until you find the first element whose IsLoaded is false. What element is that? What is the ancestor element that removed it from its visual tree (e.g. it may be in a contentpresenter but what is that contentpresenter's templatedparent)?
BTW there were some cases where this came up inside the xamRibbon and xamDockManager and we were able to get around it - at least in the specific scenarios we found. So if you're using those controls and they are ancestors of the elements having an issue its possible that the issue may not happen in the latest versions. I don't know what version you are using or what controls the problem controls are within so I can't be sure.
Unfortunately I don't have a project which is small enough to upload. I have tried to recreate it, but in a small app it seems to work fine.
Do you have any pointers which we could try out to see if we could resolve the issue? It does sound like that it's a problem with WPF rather than the ThemeManager, but changing the theme using the ThemeManager was the only way we got this behaviour.