<TextBox Text="{Binding MyTitle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
在使用 x:Bind
时是否有与此等效的方法?
如果我这样使用它,它只会在焦点改变时更新。
<TextBox Text="{x:Bind ViewModel.MyTitle, Mode=TwoWay}" />
最佳答案
Ken Tucker 是对的,x:Bind 没有 UpdateSourceTrigger 属性,它的行为就像设置为 PropertyChanged 一样,但 TextBox 在失去焦点时触发时除外。检查 this 的底部页。 所以在这种情况下你必须继续使用 Binding。
关于c# - 使用 x :Bind? 时,UpdateSourceTrigger=PropertyChanged 的等效项是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33004498/