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

BoxView.BackgroundColor binding does not work on WPF #4788

@domyd

Description

@domyd

Description

BoxView.BackgroundColor does not update when bound to a Xamarin.Forms.Color ViewModel property on WPF. It does use the inital value of the property to set its background color, but does not react to changes of the property.

Related issue: #4338

Steps to Reproduce

  1. Download and open repro
  2. Start the WPF application
  3. Click the "Switch" button

Expected Behavior

The BoxView's color should change.

Actual Behavior

The BoxView's color does not change.

Additional Info

The BoxView.Color property works as expected and could be considered a valid workaround as I did not yet come across a situation where BoxView.Color behaves differently than BoxView.BackgroundColor. In MainPage.xaml, there's a commented-out BoxView that binds the color to BoxView.Color, which works as expected.

<!--  this works  -->
<!--<BoxView
    HeightRequest="100"
    WidthRequest="100"
    Color="{Binding Color}" />-->
<!--  this does not  -->
<BoxView
    BackgroundColor="{Binding Color}"
    HeightRequest="100"
    WidthRequest="100" />

Basic Information

  • Version with issue: Latest stable (3.4.0.1008975) and latest prerelease (4.0.0.8055-pre1)
  • IDE: Visual Studio 15.9.4
  • Platform Target Frameworks:
    • WPF: .NET Framework 4.7.1
  • Nuget Packages: None

Reproduction Link

BgBoxViewBindingIssue.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions