Xamarin Forms - Label, Color and other attribute doesn't update when their Binded attributes are set

Emixam23Emixam23 ✭✭✭USMember ✭✭✭
edited June 2016 in Xamarin.Forms

I'm comming because I don't understand something about the binding..

I have this attribute in the C# code:

public string MyText { get; set; }

and then in the XAML part:

<Label Text="{Binding MyText}"/>

The first time it works, but if I change MyText string, then the <Label/> doesn't update..

I also saw some post about it, where people speak about INotifyChange or something like that, how does work this Bind? Why the update isn't constant and why it just not work same always?

The problem is that my projet is a bit complex. I have a customCalendar I made by myself which is a Grid "bind by myself again" to a DayCase[6][7] such as Windows calendar, the display is the same.

So my question is double, does I need 1 function by attribute to "listen" if one of them change? Because in the example, I just speak about one Label, but I have 1 label by DayCase, 3 Color to update, a title with Month/Year to update, etc etc

I really lost honestly, I'm sure to know how to think, how to make it..

Thank for your help!

Best Answers

Answers

  • Emixam23Emixam23 ✭✭✭ USMember ✭✭✭
    edited July 2016

    Ho thank you :o I didn't know it would work like it, can you put some documentation about it please?

  • Emixam23Emixam23 ✭✭✭ USMember ✭✭✭

    Thank :) I hope it will be helpful for people running into the same issue :)

  • AlessandroCaliaroAlessandroCaliaro ✭✭✭✭✭ ITMember ✭✭✭✭✭

    I suggest to use Fody.PropertyChanged

  • Emixam23Emixam23 ✭✭✭ USMember ✭✭✭

    what do you mean @AlessandroCaliaro ?

  • ShawnCastrianni.5092ShawnCastrianni.5092 ✭✭✭ US ✭✭✭

    he means to use this github project to make it easier to use INotifyPropertyChanged:

    https://github.com/Fody/PropertyChanged

    I have never used it before myself

  • Emixam23Emixam23 ✭✭✭ USMember ✭✭✭

    Ho okay I didnt understand, thank :)

Sign In or Register to comment.