Search code examples
c#xamldata-bindingwindows-store-apps

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}" />

Solution

  • 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.