Repository navigation
Don't use LocalValue priority for values in ControlTemplate - #7679
Conversation
Add tests to check that template values are assigned with Style priority and move other XAML control template tests alongside it in a new test class.
Allow markup extensions to detect whether they're in a control template and use that info in `DynamicResourceExtension` to use `Style` priority.
|
You can test this PR using the following package version. |
What does it do? |
|
What's the status on this PR? Couple comments to the questions:
I would expect anything within a ControlTemplate to have a Can you set an explicit priority in Xaml, or is this another Markup.Declarative issue? If so, no offense to them, but getting around these issues in C# is a lot easier than Xaml and I would say make everything template priority.
This would probably make sense to do IMO |
Understandable, but not great. I hope this and the styling system upgrades are still in the queue for 11.0. Probably reciting the obvious here, but the longer these upgrades wait, the harder it becomes to make the change. |
…ate-binding-priority
|
You can test this PR using the following package version. |
|
Now that #8479 has been merged, this PR can be merged too. We will probably want to think about changing the |
|
You can test this PR using the following package version. |
What does the pull request do?
We have an ongoing source of confusion in Avalonia in that values set in a control template are set using
LocalValuepriority meaning that they can't be overridden by style setters (to be fair, WPF/UWP have this too but it's less noticeable due to their styling system).This PR changes the XAML compiler to set literal values,
StaticResources andDynamicResources withTemplatedParentpriority, meaning that the values can be overridden in styles which have a trigger selector.Questions
TemplatedParentpriority to indexer bindings (we already have[~Foo.Bar]syntax) but how would e.g.Avalonia.Markup.Declarativedo this?{Binding}s - should they change their priority inControlTemplates? What if they have an explicitPriorityalready set?TemplatedParentpriority going to be OK here? I think it is, but I may have missed something. Do we need a separate priority?TemplatedParentpriority to simplyTemplate?Breaking changes
Styles which had non-working overrides of control template values will now come alive and potentially mess things up (you can see such a problem in the
HamburgerMenucontrol in ControlCatalog here).Fixed issues
Fixes #2789