Home > Enterprise >  How to force converter to update value in properties did not changed in Xamarin?
How to force converter to update value in properties did not changed in Xamarin?

Time:07-26

I am just curious that if any reason i want my converter to be refreshed, without the actual properties changed, can somehow i force the converter to be triggered?

Thanks in advance!

CodePudding user response:

Unfortunately, converters are indeed only triggered upon data change. Xamarin's binding values goes into details about the specifications surrounding this. Therefore unless your data changes, the converter will not "re-convert" your data.

Alternatives depending on your specific constraints or desired behavior could be to look into Xamarin's Triggers if you want to trigger your converter again depending on a state change, device behavior (rotation, network, etc) or something of the sort.

Lastly, if this is really a periodically timed refresh you are looking for - I would lowly recommend this - but you could always look into having a timer pushing same value over and over again on the property you are bound to and converting.

  • Related