-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 11 Theming Changes #8870
Conversation
Need to fix the public imports
Window styling and Theming API
…11theming/staging
…net/wpf into feature/win11theming/staging
Todo: Navigate icons not showing up
Fix Button Appearance and Calendar Button not showing
Adding win11 styles to Calendar
Adding win11 styles to progressbar, label and statusbar
Adding Win11 Styles to Context menu
Applying win11 theme to textblock
…anges Adding win11 styles to ScrollBar and ScrollViewer
…11theming/staging
…net/wpf into feature/win11theming/staging
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.FluentWindows/Styles/Button.xaml
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.FluentWindows/Styles/ContextMenu.xaml
Outdated
Show resolved
Hide resolved
I hope the XAML here isn't locked in for all time. I know you all had to start somewhere but WPF UI may not have been the best base. There are other versions of the Fluent v2 theme that seem to be better in some areas. i.e. https://github.com/wherewhere/ModernWpf What probably should have happened here is a DIRECT port of the WinUI Fluent v2 XAML styles to WPF. That should have been done clean by Microsoft rather than pulling in other projects that felt the need to deviate or do their own thing. Microsoft needs to be consistent across their UI frameworks and already have a source of truth: WinUI itself. |
...Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.FluentWindows/Styles/ScrollViewer.xaml
Outdated
Show resolved
Hide resolved
...pf/src/Themes/PresentationFramework.FluentWindows/ref/PresentationFramework.FluentWindows.cs
Outdated
Show resolved
Hide resolved
* Refactored WindowBackdrop, BackgroundManager, ThemeColorization * Fix Window implicit style and Textblock inheritence * Moved WindowBackdrop to OnSourceInitialized and added app context switch for disabling backdrop * Initial Accent Color update fix * Added initialization in ThemeManager. Added comments * Added UISettings to handle accent color fetching (#34) * Added UISettings RCW * Made UISettings handle fallback * Fixes UISetting Initialization
It is very important all hard-coded references to "Segoe Fluent Icons" are replaced by a dynamic resource
This will allow app developers to replace the font family on systems other than Windows 11 (i.e. get their apps to works on Windows 10 and lower). There are alternative drop-in replacements fonts available. I'm surprised the author of this PR seems to have little knowledge of upstream WinUI source code and conventions. I would encourage a deep review and understanding of upstream code before this PR is merged in. |
Co-authored-by: dipeshmsft <[email protected]>
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.FluentWindows/Styles/MenuItem.xaml
Outdated
Show resolved
Hide resolved
If the style keys (part of the public API) follow the conventions and closely match WinUI that will eliminate the majority of the future risk here. I would still like to see the control themes be based on a direct port of WinUI in the future. It seems https://github.com/Kinnara/ModernWpf might actually adopt Fluent v2 as the project is active again. |
* Updating ListBox design * Fixed Slider selected range * Fixing ListBox style colors * Fixing selected range offset issue --------- Co-authored-by: Rishabh Chauhan <[email protected]> Co-authored-by: dipeshmsft <[email protected]>
* Updatating OS version check --------- Co-authored-by: dipeshmsft <[email protected]>
* Removed TextBlock Style * Added comments for new default font size
* Renaming the project * Fixing Merge Conflicts * Correcting FluentWindows path of fonts file --------- Co-authored-by: dipeshmsft <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
These changes include a different license header compared to what is used elsewhere. Why is that? Here's an example of a new file that was added with this PR: wpf/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/WindowBackdropType.cs Lines 1 to 4 in 5a8619a
Versus the standard license header used elsewhere: wpf/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs Lines 1 to 3 in 5a8619a
The former is causing a false positive for a BSD type of license by our license detection for some reason (see dotnet/source-build#4373). We can filter that out but I'm wondering why the license header is different here in the first place. |
I found another library which has most of the Fluent v2 styles implemented in WPF: https://github.com/iNKORE-NET/UI.WPF.Modern Looking at its controls gallery, the control styles seem to match WinUI more closely. Perhaps it can be used as a reference? |
This PR is already merged, you shouldn't try to create a new discussion here. Better go to this issue #8991 and place your comments there. And by the way your suggestion was also mentioned in the initial discussion about bringing Windows 11 theming to WPF: #8533 (comment) |
Also, the repo you linked is licensed using an LGPL license which I believe is incompatible with the MIT license of this repo. |
Description
The following changes includes all the modifications required to use Windows 11-based styles, themes and controls in WPF applications. It includes the following features:
Customer Impact
Developers can use the new styles at the moment by including its resource dictionary in
App.xaml
. The following is syntax for the same:Regression
None
Testing
Local Build Pass
Regression Testing
Sample Application Testing
Future Works
The work is in accordance to Modernizing WPF applications. There stands provisions to include better opt-in mechanism, use of customizable themes and backgrounds among others.