Skip to content
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

Can't change TransparentTintBackdrop.TintColor at runtime #149

Closed
frozax opened this issue Nov 17, 2023 · 3 comments
Closed

Can't change TransparentTintBackdrop.TintColor at runtime #149

frozax opened this issue Nov 17, 2023 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@frozax
Copy link

frozax commented Nov 17, 2023

Hello,

I'm trying to change the TintColor of a TransparentTintBackdrop at runtime, using something similar to:

(SystemBackdrop as TransparentTintBackdrop).TintColor = myColor;

It's not working, the color is not changed.

I also tried to change the whole backdrop, with something like:

SystemBackdrop = new TransparentTintBackdrop(myColor);

In this case, it does indeed change the backdrop. However, there is a visible ugly glitch (as if there was one frame without backdrop at all). I also tried to precompute the backdrops to avoid the new, but I still get the glitch.

I'm using version 2.3.3.

@frozax
Copy link
Author

frozax commented Nov 17, 2023

If I change the method CreateBrush in TransparentTintBackdrop to this:

        protected override Windows.UI.Composition.CompositionBrush CreateBrush(Windows.UI.Composition.Compositor compositor)
        {
            brush = WindowManager.Compositor.CreateColorBrush(TintColor);
            return brush;
        }

It works.
Hope this helps.

@dotMorten dotMorten added bug Something isn't working help wanted Extra attention is needed labels Nov 21, 2023
@dotMorten
Copy link
Owner

@frozax Thank you! Your fix was spot on.

@dotMorten
Copy link
Owner

Just a heads up that this fix is in the latest 2.3.4 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants