So the question is pretty simple, I think:
I have a View and its associated ViewModel. I have a value generated in the ViewModel and want to pass it to the View's Code Behind, following the MVVM pattern. I know it's entirely possible, because that's basically what's happening when using INotifyPropertyChanged and Data Binding, but I want to pass the value into a variable in the Code Behind, not a XAML component.
As an example, consider something like this:
ViewModel
public string VM_String { get; set; }View's Code Behind
ViewModel MyViewModel = new ViewModel; public string View_String { get; set; }
I simply want to pass the value in VM_String onto View_String, while following MVVM principles, so something like:
View_String = MyViewModel.VM_String;
is not what I want. I'd want those values decoupled from each other.
How would one go about doing this? Something to do with delegates / events maybe?
Thanks