<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}" />
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With