Closed Omenrevlis closed 3 months ago
If you use Windows App SDK 1.4, it's fixed with https://github.com/microsoft/TemplateStudio/commit/52d63a4538c676bf97e0486a0df5d44b2cd4841a. We just need to wait @pratikone for a release binary ^^.
Looks like https://github.com/microsoft/microsoft-ui-xaml/issues/8899 @Mysterious-Dev where did you find the pr in MS repo that fixed it and for which exact version? I don't see any pr linkt to this ↑ issue.
if you to need the custom title bar in 1.4, you can move away from Window.ExtendsContentIntoTitleBar and use the new APIs under Window.AppWindow.TitleBar
https://github.com/microsoft/microsoft-ui-xaml/issues/8899#issuecomment-1742729923
What does the template do?
Looks like https://github.com/microsoft/microsoft-ui-xaml/issues/8899 @Mysterious-Dev where did you find the pr in MS repo that fixed it and for which exact version? I don't see any pr linkt to this ↑ issue.
It's a PR for TemplateStudio. I think he used TemplateStudio 5.4 and updated WindowsAppSDK to 1.4 (with new TitleBar customisation).
I know. I asked what your source was. And what method does the template use.
I am using TemplateStudio 5.4 and WindowsAppSKD 1.4
New release of Template Studio is here. Do check if it is still happening.
New release of Template Studio is here. Do check if it is still happening.
It seems that these function calls in TitleBarHelper are no longer necessary.
//var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(App.MainWindow); //if (hwnd == GetActiveWindow()) //{ // SendMessage(hwnd, WMACTIVATE, WAINACTIVE, IntPtr.Zero); // SendMessage(hwnd, WMACTIVATE, WAACTIVE, IntPtr.Zero); //} //else //{ // SendMessage(hwnd, WMACTIVATE, WAACTIVE, IntPtr.Zero); // SendMessage(hwnd, WMACTIVATE, WAINACTIVE, IntPtr.Zero); //}
New release of Template Studio is here. Do check if it is still happening.
I updated to Template Studio 5.5 on the existing solution. There is some improvement but not fully fixed.
If Windows is set to Dark Mode and App is set to default, it works. If Windows is set to Dark Mode and App is set to Dark Mode, it works. If Windows is set to Light Mode and App is set to Dark Mode, it does not work. They are hidden when window is Active. But visible when the window is inactive.
Starting a new Template Studio project to test and Good news, it works! So a new solution path is fine, but an upgrade to the Extension for Template Studio does not fix it. I can port all my stuff over to a new project. That's fine for me.
I started a template from scratch and when I changed to target .net 8 I had to add these to the project file xml for it to compile.
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Runtime.Loader.UseRidGraph" Value="true" />
</ItemGroup>
<PropertyGroup>
<UseRidGraph>true</UseRidGraph>
</PropertyGroup>
Well, I'm sorry but there is still some weirdness. Not with the pages themselves, but with ContentDialog. It tires to follow the OS for dark mode.
If OS is light mode, and app is set to default all is great. If OS is dark mode, and app is set to default all is great. if OS is dark mode, and app is dark mode all is great. if OS is dark mode, and app is on light mode, the dialog is in dark mode. If OS is in light mode and app is in dark mode. the dialog is in light mode
Just for reference, the content of the dialog box is a Page object.
There is also a measly bug I think no one would care too much about. If the app is set to default and you have a dialog on screen from your app when the OS is changed to a dark or light mode, it only applies to the dialog and not the main window. This fixes itself when you close and restart the app, but it feels odd when it is happening.
@Omenrevlis no bug is small. Do open an issue for that. Closing this one as it has been fixed.
Describe the bug
In Navigation Template I added the settings. By default, it implements the ability to switch the app to Dark, Light, or Default. When I change it to Dark the Mininimize, Maximize, and Close buttons are still set to forground black and are invisible unless you hover over them.
I have not modified the toolbar from what the template created. I have not messed with setting any colors of anything. This is how it is after the template studio created it.
To Reproduce
Additional context
I see where the TitleBarHelper and the ShellPage CS sets the forcolor. Interestingly, if I put a breakpoint in either and run debug to the breakpoint, then just continue running, the title bar foreground is correct.
So something is changing it back to light foreground settings, likely on another thread, but I'm not sure where.
When the main window is deactivated, you can see greyish buttons. But when the windows is active, they are the same color as the title bar (black) and cannot be seen.
Applies to the following platforms:
About your setup