WPF Binding to property and setting another -


I am using MVVM in my WPF application.
I have a window in which there is a view inside it. The value can be changed in that view and I will tie it in a text box in my main window:

   

Now I will need to force this to myViewModel.MyValue for a property inside my main window view model, so that I can filter it into a You can use the collection.

Can I use a setter or something else that sets the value of MainViewModel.Property whenever myViewModel.MyValue Does change happen?
If so, how can I do this?

Does the visual model of your "all" scene reside in the "main" window viewodol? If so, then you can only trigger these things through the setters.

If not, you can use the ancestors binding and run it from the UI. It is not ideal (I thought that you are trying to avoid the thoughts of parents and children from each other's specific knowledge), but this will work.

Here is a RelativeSample sample which is very easy. These can be quite complex. Experiment with caution:

If you decide to go do the reluctance route, then you should know how to debug the binding Use it for many Techniques, but if you are using .NET 3.5, then I recommend using that method (near the end of the article).


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -