Skip to content

Border Stoke data binding does not work #19201

Closed

Description

@kluzen

Description

Binding the Stroke property of a Border in order to dynamically set its color does not work. I would expect the property to function the same way BorderColor does on a Frame.

Steps to Reproduce

Create a new .net maui app.
Replace main page with:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiTestApp.MainPage">

  <ScrollView>
    <VerticalStackLayout
            Padding="30,0"
            Spacing="25">

      <Entry Text="#FF0000" x:Name="ColorEntry" />

      <Border BindingContext="{x:Reference ColorEntry}"
              Stroke="{Binding Path=Text}">
        <Label Text="Border Test" />
      </Border>

      <Frame BindingContext="{x:Reference ColorEntry}"
             BorderColor="{Binding Path=Text}">
        <Label Text="Frame Test" />
      </Frame>
    </VerticalStackLayout>
  </ScrollView>

</ContentPage>

Change entry text to different hex colors. The Frame control updates but the Border control does not.

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Activity

  1. added
    t/bug
    on Dec 4, 2023
  2. drasticactions commented on Dec 5, 2023

    @drasticactions
    Contributor

    This could be similar, if not the same as, #19075

    The underlying binding is sending values to Border, but it's not being redrawn if changed. So it may not be the binding not working, but the control not properly updating with the change.

  3. added
    area-xaml
    on Dec 5, 2023
  4. ghost added
    legacy-area-controls
    on Dec 5, 2023
  5. added
    s/needs-repro
    on Dec 21, 2023
  6. ghost added
    s/no-recent-activity
    on Dec 25, 2023
  7. ghost closed this as completedon Dec 28, 2023
  8. locked and limited conversation to collaborators on Jan 28, 2024
  9. ghost removed
    s/no-recent-activity
    on Jan 28, 2024
  10. removed
    legacy-area-controls
    on May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-borderarea-xamlplatform/androids/needs-reprot/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions