Passing Objects to a Page

1 reply. Last post: August 13, 2013 7:57 AM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

I am developing a multi page WPF application where I would like to pass an object from one page to another.  I have a Main Window with a UXFrame and URI Mapping.  When I attempt to navigate to a page while passing it an object (in my case I want to pass it a database object called Patient). 

<Intersoft:UriMapping Uri="/TrainingOptions/ {SelectedPatient}" MappedUri="/Views/TrainingOptionsPage.xaml?patient={SelectedPatient}" />

I then navigate in my ViewModel after a confirmation dialog.

Uri navUri = new Uri("/TrainingOptions/ " + SelectedPatient, UriKind.RelativeOrAbsolute);
                NavigationServiceProvider.Navigate(navUri);

How do I pass this vaiable to the next view model using a MVVM pattern?  I have seen exaples in the documentation, but they do not say how to pass objects using MVVM.  I have used a messenger class in the past but there has to be an easier way.  

 

All times are GMT -5. The time now is 7:24 AM.
Previous Next