Closed ghost1372 closed 2 years ago
Try setting the window style to WS_EX_NOREDIRECTIONBITMAP.
@nahomebssa Window does not have a style property, How should I set the style?
@nahomebssa Window does not have a style property, How should I set the style?
He probably means the Win32 "Extended Window Style", which can be set during calling CreateWindow or be set by calling SetWindowLongPtr at runtime. For WinUI3, you can hardly change the behavior of CreateWindow, while SetWindowLongPtr doesn't support all styles. I'm not sure if it works for WS_EX_NOREDIRECTIONBITMAP.
But it seems you should somehow set the background of ClientArea to transparency... Why WPF can handle it automatically?
@jevansaks FYI, looks pretty interesting!
@codendone FYI as well
But it seems you should somehow set the background of ClientArea to transparency... Why WPF can handle it automatically?
@seven-mile It doesn't, the example sets the background to transparent. Like you recommended, and is the exact thing WinUI 2 does. https://github.com/Difegue/Mica-WPF-Sample/blob/c579d038f762053e84b03f24acf0c8fc24e13d31/MicaTest/MainWindow.xaml#L9
Window in WinUI 3 doesn't have Background property. How can I set it to transpararent?
Window in WinUI 3 doesn't have Background property. How can I set it to transpararent?
I think that's why Mica is still not out?
Window in WinUI 3 doesn't have Background property. How can I set it to transpararent?
I think that's why Mica is still not out?
I changed the Windows style as mentioned above but nothing happened😫
I read that this method may no longer be supported since Windows 11 Build 22494.1000? I can't confirm this myself though.
I read that this method may no longer be supported since Windows 11 Build 22494.1000? I can't confirm this myself though.
Can't confirm on 22494 either, but it surely doesn't work for 22504+
@seven-mile FYI, Mica Sample available in WASDK-Sample Repo, but only for C++, can you convert it to c#?
Doesn't look like it's going to work very well in WPF since it requires the use of a Visual layer, thus creating the airspace bug.
You need to set the background of your application to transparent.
You can do this via Win32 API calls. I have created a sample project here: https://github.com/IcySnex/WinUI3-Transparent-Mica-Acrylic-Blurred. You can also look at a video here: https://www.youtube.com/watch?v=mfS8PT9Z3u8. But be aware that you need to have at least the WindowsAppSDK version 1.1 - preview 1.
That method depends on a private API that has been removed since 22494+ (in 22523 and later it's replaced. The proper way is to use Windows.UI.Composition.Compositor
, however this approach requires either a swapchain or a HwndHost
(or some other way idk), the latter causes the airspace problem.
I know Mica is not supported yet. However, with the help of some PInvoke functions, Mica is activated on WPF apps
so I tried to do the same in WinUI3 preview 3
TitleBar activates Mica well, but not Windows content
Is there a solution?😁