Skip to content

Fixing Fluent Style Issues #10393

Open
6 of 9 issues completed
Open

Description

@dipeshmsft

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:

  1. Match resource usage in control styles with WinUI resources where possible
  2. Add animations for controls where required to match WinUI.
  3. Compare Fluent styles with Aero2 styles to match
    3.a. Properties like HorizontalAlignment, VerticalAlignment
    3.b. TemplateBinding comparison with Aero2 styles
  4. 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

List of Controls

The following control styles are part of Presentation UI, hence we won't be working on these in the current task. There fore marking them as complete.

  • DocumentViewer
  • FlowDocumentReader
  • FlowDocumentScrollViewer
  • StickyNoteControl
  • InkCanvas

Related Issues:

These issues refer to the type of problems that we have in Fluent styles currently :

Sub-issues

Sub-issues

6 of 9 Issues completed
Loading 9 sub-issues

Activity

  1. dipeshmsft commented on Feb 4, 2025

    @dipeshmsft
    MemberAuthor

    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.

    /cc @dotnet/dotnet-wpf-triage @robert-abeo @MichaeIDietrich

  2. added this to the milestone on Feb 4, 2025
  3. added
    User Story
    on Feb 4, 2025
  4. moved this from 🥅 Todo to 🏗 In Progress in WPF Fluent Themingon Feb 4, 2025
  5. robert-abeo commented on Feb 4, 2025

    @robert-abeo

    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?

    1. 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
    2. If you are trying to backport WinUI Fluent to WPF then use visual states
  6. andreaCosm commented on Feb 21, 2025

    @andreaCosm

    Thank you for your efforts, just found this ticket while trying to understand the new Fluent controls, having just switched to the newest version of WPF. I want single out that the tab control needs better states and contrast. There's no hover animation; the selection also doesn't seem update the color with selection either although I do see that working in the example. Are we supposed to use a specific background color with it?

    Image

                        <TabControl>
                            <TabItem Header="Audio">
                                <TextBlock Text="Audio Settings" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </TabItem>
                            <TabItem Header="Video">
                                <TextBlock Text="Video Settings" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </TabItem>
                        </TabControl>
    
  7. dipeshmsft commented on Feb 25, 2025

    @dipeshmsft
    MemberAuthor

    @andreaCosm, thanks for bringing this up, I have created a subissue for TabControl, can you add the above inputs there, for better tracking.

  8. modified the milestones: , 10.0.0 on Apr 9, 2025
  9. jroessel commented on Nov 12, 2026

    @jroessel

    Commenting here so they might be turned into sub-issues, perhaps. If this is better as separate issues I can do that as well.

    I've recently done a visual overhaul of a WPF application, taking inspiration from another in-house app that uses Material Design, but basically porting it over to Fluent Design because WPF had many controls already usable for Fluent. A few things stood out where the current state of the theme is not as nice to work with as I had hoped.

    1. There is no visual indicator for a disabled Slider (apart from the Thumb not animating on hover).
    2. In other cases some predefined Styles for control variants (e.g. subtle buttons, or switch-style checkboxes) would have been helpful. Right now there is a lot that has to be done by hand, which in some cases requires redoing the control template. While many controls are not that hard to template it's still something that takes more work than perhaps necessary.
    3. Drop shadows in Popups are mostly broken (e.g. for the ComboBox drop-down) since the Popup does not extend far enough outwards to render the shadow (except in the rounded corners). This can be rectified by adding a margin to the border inside, which nicely enough still works with Popup positioning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    User StoryWin 11 Theming

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions