Now it's time to see how we can make use of two way data binding.
So if we switch over to our main window example, you can see that we have defined the mode for our
data binding right here textbox text binding name mode one way instead of one way.
We can now write down two way so that we can update our data from our UI elements and the other way
around works the same.
Now we have binding name right here.
We can also say Path, for example.
So you can really specify that and how this works is in the end it takes a look at our data context.
So let me just show that again.
Here is our data context.
It's a person, right?
And if we define H as the path, it will actually look up inside of the data context object, whatever
this is.
If such a property exists and if it does exist, we will create a binding with that property.
Very cool.
Now let's start the application.
There we go.
Let me now change that to Peter.
Set the value of H to 20 hit info and you can see Peter is 20 years old.
So now we did modify our data inside of our application from within the UI elements just to get that
clear.
We are binding that to our data context.
And finally, we're changing the data inside of this person, which we can verify because we are printing
out this well properties right here.
So we definitely know that we have updated our person object.
Great.
And that's it already on two way data binding.