Passing parameter from Datagrid to another UserControl

Jan 7, 2014 at 6:08 AM
I have a datagrid in my HomePage.
When user clicks on an item in the datagrid, another UserControl with details on the clicked item should display.
Note: data is retrieved from database.

How do I achieve this?
Any suggestion will be of great help.
Thanks.
Jan 10, 2014 at 12:43 PM
Thats not a special question to the mui-project.

If you use CodeBehind, you can take for Example a Doubleclickevent to fill the fields.

If you use the MVVM Pattern you can fire a Command (for Example a Doubleclick) which is bound in the Viewmodel.
The "HomePage" should have set the ViewModel as DataContext. The UserControl gets its Viewmodel Instance from the Parentcontrol.