Click here to Skip to main content
15,895,777 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I'm using .Net FW 4.5, VS 2013 and SQLITE. I've got a "MainWindow" that contains tab items. Each tab item has it's own view and each view has its own VM. I am running a query on my MainWindow that returns data to a datagrid. Depending on which "SelectedItem" is selected I need my query to return relevant sub data to my tab which contains my view/viewmodel... how do I get my main VM to pass a value to my Sub-VM... I've tried "FindVisualParent" but it does not work. I think it's loading up my value after everything is loaded and therefore not applying my filer on my sub-VM query... Hope this makes sense.

Best methods applicable to MVVM would be appreciated.
(will try and upload sample project...)

on OneDrive... Download Sample Code
Posted
Updated 4-Jan-15 20:50pm
v4
Comments
George Swan 9-Jan-15 1:29am    
I suggest that you have a look at the Prism QuickStarts, especially the interactivity sample.

http://msdn.microsoft.com/en-us/library/gg430879(v=pandp.40).aspx

1 solution

Hi,

You need to use PRISM's event aggregator pattern to pass data from one VM to another VM.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900