The final mode of data binding.
The last one is like one way to source data binding.
And for that I just want to switch to one way data binding again.
So one way we already talked about that was the first one.
Let's start our application now in one way, data binding, we are binding from our source property.
So let's say the data in our application to our UI elements, right?
So Yannick and 30 it get read from our data source right here we initialize it with Yannick and 30.
This is we are setting the data context and then the data will get bound and the binding goes in one
direction from source to our UI elements, the target.
Now if I change that, let's say ten, it does not work because it only works in one way.
We have already discovered that now we can do it exactly the other way around, and for that we will
simply use the one way to source data binding.
So one way to source, which basically means UI element to source, right?
So one way to source.
Let's start our application one more time.
Now it works the other way around.
So we will not see any initial data because the data flow is working the other way around.
So we do not initialize the data from our source.
Instead, we can set the value, let's say, Peter and let's say 50.
Even though inside of our code we still initialize with Yannick and 30.
We now see that if I go back to the application, we are able to hit info and see Peter is 50 years
old because our binding or our data flow is now working from our target, which is UI to our source,
which is our data in the application, right?
So it's just the other way around.
Now we can update our data inside of our application from the UI and not the other way around.
So those are all the options that you have for data binding and one time data binding and one way to
source data binding are not as commonly used as one way and two way data binding.
So the first two that we have covered, they are getting used most of the time.
But you should definitely also know about the one time data binding, for example, for loading configuration
or for one way to source data binding.
What we have just discovered in this video and that's it about data binding.