Hi,
I have an application that has a mixture of Panels defined in XAML as well as a number that I dynamically add on demand.
My problem is that when I only use the statically defined Panels the application starts and on drag/undock the correct styling is applied to the floating panels. When I dynaamically create panels during startup the styles are no longer used when the panel floats.
I am sure that I am missing some "magic" code here to set the styles (although I wonder why default styles are not automatically used in this case).
My styles define a custom chrome for the floating windows and use UseOsNonClientArea=false to achieve this.
Does anything spring to mind out there?
Regards,
Graham
There should be no difference between defining the panes in xaml or in code. One thing that you should be aware of that will affect the floating panes either way is that the panes that are floating are in a separate WPF Window and therefore they are not part of the logical tree of the xamDockManager and therefore they will not be affected by any implicit styles defined within the xamDockManager or its containing Window. They would only be affected by resources defined in the application's resources or styles from the Theme that is set or things that you explicitly put into the Resources of the ToolWindow (e.g. in the ToolWindowLoaded event).
Having checked I see that your application has referenced the project resources in the App.xaml. For the styles we have copied the xamDockManager styles fully and made changes. That of course means that they are defined as new "default" styles. As you said there seems to be a missing "link" to these styles somewhere - and I am betting that there is a thread building these panels out of sight of the styles somewhere.
I will be looking into your suggestion of loading within the ToolWindowLoaded event. Question is however would it be better loading on a per-style basis or as a resource load bearing in mind that the application is part of a larger corporate defined project with rather lerge resource files and that this is also an event handler? What is your suggestion here Andrew?
Regards