Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent to UpdateSourceTrigger=PropertyChanged when using x:Bind?

<TextBox Text="{Binding MyTitle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

Is there an equivalent to this when using x:Bind?

If I use it like this, it only updates when focus is changed.

<TextBox Text="{x:Bind ViewModel.MyTitle, Mode=TwoWay}" />
like image 682
Laith Avatar asked Oct 08 '15 00:10

Laith


2 Answers

Ken Tucker is right, there is no UpdateSourceTrigger property for x:Bind and it behaves as it was set to PropertyChanged, except in case of TextBox when it triggers on lost focus. Check the bottom of this page. So you have to keep using Binding in this case.

like image 189
Péter Bozsó Avatar answered Nov 02 '22 10:11

Péter Bozsó


For anyone reading this after 2017, UpdateSourceTrigger has now been added and is described in the documentation. I believe it was added in Fall Creators Update (build 16299), so if your min version is 16299 or higher you will be able to use UpdateSourceTrigger.

If you're targeting an older version of Windows you will have to keep using Binding.

like image 7
Simon Touchtech Avatar answered Nov 02 '22 11:11

Simon Touchtech