last day (15 days later) » 

11:44 PM
1
A: WPF MVVM Light - About views communicating

OmegaMan Is it possible to, within the 'Content' View to TOGGLE the panel, 'C', which is NOT within the view? Create a shared VM which each other VM will have a property for which it can access. This VM can be loaded with during initialization of the other VMs. To allow for changes to happen put IN...

 
Thank you, I will try this.
Do you have a code example by chance? It seems like you want to create a way to relate view models to other view models... Doesn't this violate the idea of the MvvM framework?
 
@user1296981 As long as one's data exists on something that is not a model or not a view that is the MVVM concept. Having a ViewModel with a property which is simply a reference to another VM is basically a hierarchy of data; nothing more nothing less.
@user1296981 See updated post for a basic example.
 
Thank you for this.
I'm having some issues with those since the control I need to hide/show is not in the Main Window, but the toggle button to handle it IS located in the MainWindow.xaml.. I can't seem to bind the visibility to the AV.IsVisible property I made from the other view, since they are not using the same VM.
 
@user1296981 Does the other VM you mentioned have an AV property?
 
I added an AppVM property to both my MainWindowVm and my FilterVM.
Declared: public ApplicationVM AV { get; set; }
Construcotr for both VMs: AV = new ApplicationVM() { IsFilterToolBarVisible = false };
so toggling the button should switch it to true, and then i put a booltovis converted on the visibility of the dockpanel that i want to show, which is located in the other view (which has the view model with the 2nd declaration of AV)
Also, something else is strange.. When I toggle the variable in the construct in a VM, doesn't matter which of the 2, from false to true it shows in the designer.
I moved this to a chat room
 

  last day (15 days later) »