0

I have Grid whose Background will be altered according to the color of album art at the run time. And I change the Background using the following code:

        return new AcrylicBrush()
        {
            BackgroundSource = AcrylicBackgroundSource.HostBackdrop,
            TintOpacity = 0.75,
            TintColor = Color.FromArgb(bgra[3], bgra[2], bgra[1], bgra[0])
        };

However, the HostBackdrop is causing the trouble for me. As you can see from the images I post below, the background turns white it loses focus. It is normal when the window has focus. And when I change the HostBackdrop to Backdrop, the color no longer changes. But I do want to use HostBackdrop.

How can I achieve that? Thanks in advance!

Unfocused

Focused

1 Answers1

1

Currently AcrylicBrush only works when the window gets focus, you can view the document with a description of this

If you need to set the color of the AcrylicBrush when the window loses focus, you can use the FallbackColor property.

Best regards.

Richard Zhang
  • 7,523
  • 1
  • 7
  • 13
  • Thank you! Problem solved! Could you please look at my other unanswered questions? –  Aug 26 '19 at 08:25
  • Thank you for your mark, my companion is researching your question, reply will be soon. – Richard Zhang Aug 26 '19 at 08:58
  • I really appreciate your helpfulness. Could you take a look at this [one](https://stackoverflow.com/questions/57478990/uwp-visualstatemanager-pointerover-does-not-work)? –  Aug 26 '19 at 12:03