xamarin/Xamarin.Forms

DynamicResources set in different conditions of DataTrigger correctly applies only value set in first DataTrigger.

Aperta

#4978 aperta il 14 gen 2019

 (1 commento) (1 reazione) (1 assegnatario)C# (1926 fork)batch import
a/Xaml </>e/4 :clock4:help wantedinactivet/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Description

We have 2 colors (DynamicColor1, DynamicColor2) in Page's ResourceDictionary: 1 We have button which creates new random colors and updates these resource values: 2 We have 2 BoxView where we set its BackgroundColor to these resources: 3 We have BoxView where we set BackgroundColor to these colors in DataTriggers based on some condition (Switch's toggle state for instance): 4 By updating color resources first two BoxView's colors updated correctly. BoxView with colors set via DataTriggers updates its colors inconsistently.

Steps to Reproduce

  1. Run attached project.
  2. Press button "Update colors" several times - colors in top 2 boxes updated, bottom box tracks color of top left box.
  3. Toggle switch, press "Update colors" several times - bottom box should track color of bound top box (toggled=false - left, toggled=true - right).
  4. Toggle switch off, then on.
  5. Press "Update colors"

Expected Behavior

Bottom box should track color of top right box

Actual Behavior

Bottom box stuck at its previous color value.

Basic Information

  • Version with issue: Xamarin Forms 3.4.0.1008975
  • Last known good version: Unknown
  • IDE: Visual Studio

15.9.4

  • Platform Target Frameworks:
    • iOS
    • Android
    • UWP

Screenshots

dynamic_resource

Reproduction Link

DynamicResourceTest.zip

Guida contributor