I am using a ResourceDictionary at the head of a visual tree to specify a Style Setter on a control type used in several ContentPanes further down the visual tree.
However, when I make a ContentPane floating, the Style Setter no longer applies to the control within it.
How do I resolve this without duplicating the ResourceDictionary or the Style Setter in more than one place?
I've attached a project demonstrating this. All XamTextEditor controls have a DarkBlue Background until the ContentPane they are within is floated.
Thanks,
Jason
When the panes are floating they are not within the tree of the xamDockManager - this is true whether you are using it in a windows app or in xbap. If you put that ResourceDictionary into the Application.Resources it will affect both so that's the easiest option. Alternatively you would create a separate ResourceDictionary file and reference that from multiple places. I've attached a modified version of the sample that does this.
Hi Andrew, I already had a separate file in my actual application, but I simplified the example I provided. I have too many places where I would have to reference it though, so the solution of using the Application.Resources is a much better idea.