Xamarin.forms: Label with FormattedString not updated!

Created on 19 Sep 2018  路  1Comment  路  Source: xamarin/Xamarin.Forms

Description

Hi,
the same data bound to Label, one without FormattedString and the Other with FormattedString respectively
when updating the Data in code behind, the Label with FormattedString not updating, is this intended ?

Expected Behavior

data update

Actual Behavior

data not updating when it changed programmatically (in code behind)

Basic Information

  • IDE: VS
  • Platform Target Frameworks:

    • Android: 6.0

    • iOS: not tested

    • UWP: not tested

Screenshots

2018-09-19_15-18-00

Reproduction Link

update the data in code behind
XAML

//...
<Label>
    <Label.FormattedText>
        <FormattedString>
            <Span Text="MyData : " TextColor="Blue"/>
            <Span Text="{Binding Data}"/>
        </FormattedString>
    </Label.FormattedText>
</Label>

<Label Text={Binding Data}/>
//...

Most helpful comment

default binding mode for Span.Text is OneTime. use {Binding Data, Mode=OneWay}

if that doesn't fix it, please reopen

>All comments

default binding mode for Span.Text is OneTime. use {Binding Data, Mode=OneWay}

if that doesn't fix it, please reopen

Was this page helpful?
0 / 5 - 0 ratings