You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WPF's Fluent control styles have some issues which need to be addressed to bring the styles at parity with WinUI Fluent styles and make them production ready. We also need some changes to default values of properties ( like HorizontalAlignment, etc. ) to minimize UI breaking changes for applications moving from Aero2 to Fluent.
Here are the broad categories of tasks that need to be done per control for this:
Match resource usage in control styles with WinUI resources where possible
Add animations for controls where required to match WinUI.
Compare Fluent styles with Aero2 styles to match
3.a. Properties like HorizontalAlignment, VerticalAlignment
3.b. TemplateBinding comparison with Aero2 styles
Compare WPF Fluent styles with WinUI styles :
4.a. Convert ControlTemplate Triggers to VisualStates ( to simplify animation's and bring parity with WinUI styles )
4.b. Convert StaticResource's to DynamicResource for properties where customization is needed.
4.c. Define resources for CornerRadius, Thickness, etc. for the controls where it is needed
I would like to know others opinion on 4.a. and 4.b. Here are my thoughts on the above points:
Point 4.a:
Moving from ControlTemplate.Triggers to VisualStates will bring parity in WPF and WinUI Fluent styles.
It is also make it easy to add animations for controls similar to those in WinUI
However, it marks the departure from the way styles are usually written in WPF. I am guessing most developers and third party libraries use Triggers to handle changes for Hover / Pressed states, etc. I am guessing this will make it harder for apps to migrate to new theme as well.
I was thinking that we should use both of them, but animations are the ones that will be handled by VisualStates only and property value updates are handled via Triggers.
Point 4.b:
This will be a performance tradeoff if we switch StaticResources to DynamicResource for margin and padding, to allow customization in the way WinUI does it.
My thoughts here are that resources which are bound to setters of control styles for these properties ( margin , padding : non color properties ) should be used as StaticResource as it is easy enough to customize the styles by just creating a new style based on default style and overriding the required setters.
Personally, I prefer Triggers compared to visual states. Triggers are just so much more intuitive and easy to use. However, they are not as powerful and can't be used in all cases.
I think this comes down to how you want to create the Fluent themes?
If you are starting from Aero2 then modifying to make it visually look like Fluent then prefer triggers -- what is done in Aero2 for the most part I believe
If you are trying to backport WinUI Fluent to WPF then use visual states
Description
WPF's Fluent control styles have some issues which need to be addressed to bring the styles at parity with WinUI Fluent styles and make them production ready. We also need some changes to default values of properties ( like HorizontalAlignment, etc. ) to minimize UI breaking changes for applications moving from Aero2 to Fluent.
Here are the broad categories of tasks that need to be done per control for this:
3.a. Properties like HorizontalAlignment, VerticalAlignment
3.b. TemplateBinding comparison with Aero2 styles
4.a. Convert ControlTemplate Triggers to VisualStates ( to simplify animation's and bring parity with WinUI styles )
4.b. Convert StaticResource's to DynamicResource for properties where customization is needed.
4.c. Define resources for CornerRadius, Thickness, etc. for the controls where it is needed
List of Controls
The text was updated successfully, but these errors were encountered: