-
Notifications
You must be signed in to change notification settings - Fork 677
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
Mica material doesn't works in XAML Islands #5319
Comments
@jevansaks Is this expected? |
@marb2000 FYI |
Yes, but we should use this issue to track making it work. The problem is that currently we only know how to get the current Window -- there's no way to get the DesktopWindowXamlSource from an element. We'll need an API for apps that want to do this to tell us what the DesktopWindowXamlSource is to set the mica brush in the right place. |
Is that not what XamlRoot is for? |
In any case, the |
You can have mica material support in Windows 11 and Windows 10 using DWM Private API, The DWM Api has a private function called A sample demo of this is available Here. compositor->SetAcrylicEffect(hwnd, AcrylicCompositor::BACKDROP_SOURCE_HOSTBACKDROP, param); To compositor->SetAcrylicEffect(hwnd, AcrylicCompositor::BACKDROP_SOURCE_DESKTOP, param); This will use the desktop Live bitmap as backdrop. Change the Tint Opacity and blur amount for desired effect. This might even be possible in windows 8 and above, because windows 8 and above also has these functions in dwmapi.dll. I highly does not recommend using DWM private functions, since it can be changed or removed any time, but having something is better than having nothing😁 |
Or we could just use acrylic on Windows 10 and manually use the Mica composition API on 11, until WinUI 2 ships a fix. |
Ya its the better option than trusting private Api |
I added some code implementing mica as a composition brush in the linked app window related issue. |
Unfortunately, this code does not help because I use C++ |
This app which forces all win32 apps to get "mica effect" titlebar and even backdrop. Hopefully this can help. |
No, it does not help, as composition attributes are ignored by XAML islands. |
Any update on this? @StephenLPeters @jevansaks It's been well over a year and I still cannot use Mica. |
Bump, still an issue |
Just wanted to add context for closure - this is in WinUI2-specific Mica implementation, and unfortunately we are unable to investigate most WinUI2-only issues due to the current focus on WinUI3 (more on the policy here). If this is a blocker, please consider migration to WinAppSDK where MicaBackdrop provides fully-featured support for this material. |
Describe the bug
Mica material either renders as fully transparent or just plain white in XAML islands.
Steps to reproduce the bug
Steps to reproduce the behavior:
muxc:BackdropMaterial.ApplyToRootOrPageBackground="True"
to a pageExpected behavior
I expected to see the Mica brush.
Screenshots
Version Info
NuGet package version:
[Microsoft.UI.Xaml 2.6.0]
Windows app type:
Additional context
I don't have a repro project due to the complexity of getting XAML Islands and WinUI set up together.
The text was updated successfully, but these errors were encountered: