question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reveal, Acrylic, etc. always use the fallback color when using WinUI in a custom control hosted in a Win32 Desktop Application

See original GitHub issue

Describe the bug Whenever a XamlCompositionBrushBase is used from Microsoft.UI.Xaml.Media after following the steps at Custom XAML Control, all of the brushes use their fallback color instead of the correct color. This does not happen when using XamlCompositionBrushBase brushes from Windows.UI.Xaml.Media

Steps to reproduce the bug

  1. Follow the steps at Custom XAML Control
  2. Set the background of the custom control to an AcrylicBrush from Microsoft.UI.Xaml.Media using HostBackdrop.
  3. Build and run the program. Notice how the brush always uses the fallback color.
  4. Try again, but with AcrylicBrush from Windows.UI.Xaml.Media. But now, notice how the brush works and does not use fallback.
  5. You can also test the above steps with a RevealBorderBrush, reveal brushes from Microsoft.UI.Xaml.Media also always use the fallback color.

Expected behavior The XamlCompositionBrushBase should work just like the platform brush;it should not always use the fallback color.

Version Info WinUI Version: 2.4.0-prerelease.200422001 (using prerelease because my application is unpackaged) Windows 10 version 1909 OS Build 18363.778 Desktop Only

NuGet package version: Microsoft.UI.Xaml: 2.4.0-prerelease.200422001

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mdtaukcommented, Sep 28, 2020

I have advocated for a FauxCrylic mode being added, but rather than be seen as a stop gap, it should be used as a performance mode, so the development time and effort can be better justified, and Tablet Mode on devices like the Surface Go will benefit from not being full of Fallback Solid Colours.

If it persists after Live Acrylic is restored for WinUI 3.X - then the work does not go to waste, as the performance mode can still be there, and still be useful.

2reactions
shaheedmalikcommented, Sep 28, 2020

@DmitriyKomin If possible, can the brushes use their normal mode if the parent of the XAML Desktop Window correctly handles things like activation requests, dpi changes, etc?

@shaheedmalik It’s pretty clear that HostBackdrop Acrylic won’t and cannot be decoupled from the OS, (I hope they prove me wrong) because it depends on DirectComposition and the DirectX frame buffer & swapchain.

Then a faux acrylic brush needs to be made to fill in for it in WinUI3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AcrylicBrush.AlwaysUseFallback Property - UWP
Gets or sets a value that specifies whether the brush is forced to the solid fallback color. Equivalent WinUI 2 API for UWP:...
Read more >
Using a SystemBackdropController with WinUI 3 XAML
This article describes how to apply Mica or Acrylic as the base layer of your Windows App SDK/WinUI 3 XAML app. To use...
Read more >
How to implement acrylic windows effect in WinUI3 ...
When creating WinUI 3 (Windows App SDK 1.0) project with VS 2022, I am unable to implement the acrylic background effect on Windows....
Read more >
XAML – Windows Developer Blog - RSSing.com
As with XAML, Edge supports rendering color fonts by default in websites and web apps, including the XAML WebView control. Simply use HTML...
Read more >
🤔 Thoughts on future of MAUI for desktop software? ...
My enthusiasm for MAUI has waned a bit as it gets closer to release. I think on Windows Desktop it's going to be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found