I have a requirement to modify a very small part of the WPF ComboBox template.
If I take a copy of the existing template for the Luna theme and make a change, everything will work fine initially. But if the user has a different theme, my ComboBox retains its custom theme (which is obviously based on Luna), so it looks out of place.
Is there a way to override only parts of the template, so most templates are still Windows related?
I noticed that parts of the template define the mwt namespace with an explicit reference to Luna:
xmlns:mwt="...blah blah...=PresentationFramework.Luna"
maybe there is a way for this mwt namespace to refer to the current topic, and not just to Luna one?
Or do I need to provide a custom copy of the template for each topic? And what happens if MS creates a new theme, will I need to update my template to support it?
(the bit that I change only refers to the TextBlock displayed when the combo box is closed. I do not change the drop-down list or button. Ideally, I would just override SelectionBoxItemTemplate with a ComboBox but this is read-only, so as far as I can tell, I you need to redefine the entire management template to make any changes.)
[Related question, but no answers: Customize the management template and still respect the OS theme? ]
source share