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
{{ message }}
Repository navigation
Windows 11 Theming Does Not Work In PowerShell WPF Window #9373
Current Result: Black window, although I can tell the elements are there because if I hover over the textbox my cursor changes. Doesn't appear to be properly loading the ResourceDictionary
Confirmed that my PowerShell 7 console is using .NET 9 preview 4:
Hey @antonfirsov, there is a slight issue here. As of now, the mechanism for accent color, theme switching, etc. will work when the resource dictionary is added to App.xaml, in coming preview releases we will add the support for using Win11 themes at window level explictly.
For now, you will have to add it in your app.xaml.
Hey @antonfirsov, there is a slight issue here. As of now, the mechanism for accent color, theme switching, etc. will work when the resource dictionary is added to App.xaml, in coming preview releases we will add the support for using Win11 themes at window level explictly.
For now, you will have to add it in your app.xaml.
@dipeshmsft Appreciate this insights. Is there an issue, branch, or PR that can be tracked to know when it is released?
@nkasco@antonfirsov we are currently working on theme switching feature for Fluent, so we couldn't get back to this. However, we will fix this soon enough. For now, I will add it in the tracking issue and assign the label to this bug.
Reacted by Nathan Kasco, Violet Hansen and lindexi
@nkasco, can you tell me if there is a way to test this with a local set of binaries ? We have just merged the Theme switching APIs, and wanted to test this with the recent changes.
@nkasco, can you tell me if there is a way to test this with a local set of binaries ? We have just merged the Theme switching APIs, and wanted to test this with the recent changes.
If that doesn't work, instead of Add-Type -AssemblyName PresentationFramework you could try Add-Type -Path "path\to\PresentationFramework.dll" (might also need to load in PresentationFramework.Fluent.dll if you do that)
@dipeshmsft We are in business! I didn't do an extensive test on all object types, but definitely seems to be propagating the theming from the Window element now.
If I find anything odd I will report it back here. If I don't find anything in the next week, or unless you know of an reason otherwise, at that point we can probably close this one out.
If I am not wrong, I think I saw a comment stating otherwise yesterday. What was the issue earlier ?
I also wanted to state that you can give Window.ThemeMode property a try.
If I am not wrong, I think I saw a comment stating otherwise yesterday. What was the issue earlier ? I also wanted to state that you can give Window.ThemeMode property a try.
You're right, i posted a comment before but deleted it because i figured it out.
Can we use the new Windows 11 style themes on <UserControl> elements too? because it doens't seem to work when I try it like this
@HotCakeX@nkasco thanks for bringing this issue. It took us some time to get to it but since this is fixed now, I am closing this issue now. If you have any more issues, feel free to open a new issue.
Activity
antonfirsov commentedon Jun 2, 2024
cc @dotnet/wpf-developers
dipeshmsft commentedon Jun 3, 2024
Hey @antonfirsov, there is a slight issue here. As of now, the mechanism for accent color, theme switching, etc. will work when the resource dictionary is added to App.xaml, in coming preview releases we will add the support for using Win11 themes at window level explictly.
For now, you will have to add it in your app.xaml.
nkasco commentedon Jun 3, 2024
@dipeshmsft Appreciate this insights. Is there an issue, branch, or PR that can be tracked to know when it is released?
nkasco commentedon Jun 12, 2024
Not fixed still in .NET 9 preview 5
nkasco commentedon Jul 9, 2024
Not fixed still in .NET 9 preview 6
antonfirsov commentedon Jul 10, 2024
@dotnet/wpf-developers is there a tracking issue in dotnet/wpf we can link, so we can close this? Or should we transfer this one?
dipeshmsft commentedon Jul 10, 2024
@nkasco @antonfirsov we are currently working on theme switching feature for Fluent, so we couldn't get back to this. However, we will fix this soon enough. For now, I will add it in the tracking issue and assign the label to this bug.
dipeshmsft commentedon Jul 25, 2024
@nkasco, can you tell me if there is a way to test this with a local set of binaries ? We have just merged the Theme switching APIs, and wanted to test this with the recent changes.
nkasco commentedon Jul 25, 2024
@dipeshmsft
I have been using the fxdependent version of PowerShell: https://github.com/PowerShell/PowerShell/releases/download/v7.4.4/PowerShell-7.4.4-win-fxdependentWinDesktop.zip
If that doesn't work, instead of
Add-Type -AssemblyName PresentationFrameworkyou could tryAdd-Type -Path "path\to\PresentationFramework.dll"(might also need to load in PresentationFramework.Fluent.dll if you do that)nkasco commentedon Aug 16, 2024
@dipeshmsft Still not working in .NET 9 preview 7, although the resource path changed per #9580
Updated test script:
dipeshmsft commentedon Aug 27, 2024
The changes to fix this have finally made it in .NET 9 RC1. Can you give it a try with the latest RC1 / RC2 release ?
HotCakeX commentedon Aug 27, 2024
Where can we download them? the latest available one i see is preview 7
https://dotnet.microsoft.com/en-us/download/dotnet/9.0
dipeshmsft commentedon Aug 27, 2024
You can download the latest daily build from here : https://github.com/dotnet/sdk/blob/main/documentation/package-table.md
nkasco commentedon Aug 27, 2024
@dipeshmsft We are in business! I didn't do an extensive test on all object types, but definitely seems to be propagating the theming from the Window element now.
If I find anything odd I will report it back here. If I don't find anything in the next week, or unless you know of an reason otherwise, at that point we can probably close this one out.
dipeshmsft commentedon Aug 28, 2024
If I am not wrong, I think I saw a comment stating otherwise yesterday. What was the issue earlier ?
I also wanted to state that you can give
Window.ThemeModeproperty a try.HotCakeX commentedon Aug 28, 2024
You're right, i posted a comment before but deleted it because i figured it out.
Can we use the new Windows 11 style themes on
<UserControl>elements too? because it doens't seem to work when I try it like thisin
This is what I see
dipeshmsft commentedon Aug 28, 2024
@HotCakeX , in this case you can make it work by setting
ThemeModeonwindowrather than including the resource dictionarydipeshmsft commentedon Sep 4, 2024
@HotCakeX @nkasco thanks for bringing this issue. It took us some time to get to it but since this is fixed now, I am closing this issue now. If you have any more issues, feel free to open a new issue.
HotCakeX commentedon Sep 4, 2024
@dipeshmsft Thank u very much!