WPF Tips: TextBox实时更新Binding的Property
因为当点击toolbar中button的时候textbox不会lost focus,也就不会更新binding的property。为了能在点击toolbar的时候访问property。
<TextBox> <TextBox.Text> <Binding Path="MyBindingProperty" UpdateSourceTrigger="PropertyChanged"/> </TextBox.Text> </TextBox>
这样在修改textbox中内容的时候,property的值会实时更改。