c# - How to accomplish two-way data binding in WPF? -
I've heard a lot about two-way binding in WPF, but I'm not completely clear how to complete it Or what exactly does it mean?
I have a ListView
with a group of items in it when the user chooses a new item, then a textbox
The text of the property will be displayed to display it
But when the user changes the text in the text box I want the ListView
item to be updated immediately. Is there any two "way binding" magical WPF method of accomplishing this?
If you do not have you implement INotifyPropertyChanged
for your class would be required.
Also, when you say that you want the ListBox
item updated immediately, you mean that you type it in the TextBox
Want to change the time. By default, TextBox.Text
property updates its source when it loses focus, but you set it to UpdateSourceTrigger
to PropertyChanged
By changing: <: >
{binding source = {...}, path = whatever, UpdateSourceTrigger = PropertyChanged}
Comments
Post a Comment