michaelmsm89
michaelmsm89

Reputation: 488

Is there a 'UpdateSourceTrigger' equivalent in Xamarin Forms?

I am using Xamarin.Forms, with my view created fully in XAML. I am also using Xamarin.Forms.Labs.

I have bound an EntryCell to a property like so:

<EntryCell Label="Name:" Text="{Binding Name, Mode=TwoWay}" />

The page has a 'Save' ToolBarItem which saves the property to a database.

The issue I have is that the Name property is only updated when the entry cell loses focus after the user changes the text. Clicking the ToolBarItem does not change focus and therefore the property is not updated before being saved.

I would like the property to be updated with every key press from the user. I know of 'UpdateSourceTrigger' for Silverlight, but I can't find an equivalent way to do this in Xamarin Forms?

Upvotes: 8

Views: 3108

Answers (2)

jharrell
jharrell

Reputation: 66

There doesn't seem to be a xamarin equivalent to UpdateSourceTrigger. I have had success by removing the SetProperty call from the bound property so that the property changed does not fire, and then using EntryUnfocused to trigger an explicit PropertyChanged event.

Upvotes: 0

Christian Regli
Christian Regli

Reputation: 2256

There is no equivalent for UpdateSourceTrigger in Xamarin.Forms

Upvotes: 1

Related Questions