Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Change background brush in trigger does not work #13417

Open
Maxima078 opened this issue Jan 15, 2021 · 4 comments
Open

Change background brush in trigger does not work #13417

Maxima078 opened this issue Jan 15, 2021 · 4 comments
Assignees
Labels
a/brushes a/frame in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Projects

Comments

@Maxima078
Copy link

Maxima078 commented Jan 15, 2021

Description

When current background brush is a LinearGradientBrush, a trigger cannot update background to SolidColorBrush. Using a setter to update BackgroundColor does not work either.

Steps to Reproduce

  • Set a frame background to a LinearGradientBrush
  • Add a trigger with a setter updating background to a SolidColorBrush
  • Make your trigger trigger

Actual Behavior

Background is not updated

Expected Behavior

Background is updated

Basic Information

  • Version with issue: Xamarin.Forms 5.0.01874
  • Last known good version: none (tested with 4.8.x.x)
  • Platform Target Frameworks:
    • Android: 10
  • Affected Devices: Physical devices

Workaround

Use a LinearGradientBrush with two GradientStop set to the expected solid color

@samhouts samhouts added this to New in Triage Jan 15, 2021
@jsuarezruiz jsuarezruiz self-assigned this Jan 15, 2021
@jsuarezruiz jsuarezruiz added a/brushes s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 15, 2021
@jsuarezruiz
Copy link
Contributor

@Maxima078 On what platform/s does it happen? Could you attach a small example where to reproduce the issue?
I did a quick test, but cannot reproduce the issue:
issue13417

@jsuarezruiz jsuarezruiz moved this from New to Needs Info in Triage Jan 15, 2021
@jsuarezruiz jsuarezruiz added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Jan 15, 2021
@Maxima078
Copy link
Author

I have reproduced it on Android 10 with a physical device. Here is a repro:
Sample1.zip

@Maxima078
Copy link
Author

I've just tried with a simulator (Pixel 2 Android 9) and got the same result:
Tq4J8bgAqD

@jsuarezruiz jsuarezruiz removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified labels Jan 18, 2021
@jsuarezruiz jsuarezruiz moved this from Needs Info to Needs Estimate in Triage Jan 18, 2021
@jsuarezruiz jsuarezruiz added a/frame in-progress This issue has an associated pull request that may resolve it! labels Jan 18, 2021
@Karmageddonium
Copy link

Found some workaround:
It seems like u can replace brush with only same type brush (gradient -> gradient) with the same(!) count of gradientStops.
So id u would like to replace this

image

with this

image

you should do like this:

image

IMPORTANT

In the head of the issue there is a text "May be fixed by #13438"
that way offers to set background to {x:Null} before changing gradientBrush to solidColor - it works BUT it can cause further problems with background (for example CornerRadius breaks down)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/brushes a/frame in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Projects
Triage
  
Needs Estimate
Development

Successfully merging a pull request may close this issue.

3 participants