How do I stop binding properties from updating?

后端 未结 3 1512
长发绾君心
长发绾君心 2021-02-06 01:30

I have a dialog that pops up over the main screen (it\'s actually a user control that appears on the page as per the application demo from Billy Hollis) in my application that h

3条回答
  •  囚心锁ツ
    2021-02-06 02:02

    Have a look at the Binding.UpdateSourceTrigger property.

    You can set the Binding in your dialog like so

    
    

    And then call the UpdateSource method in your button save event

    myTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
    

    Once you've called UpdateSource the source object will be updated with the value from the TextBox

提交回复
热议问题