iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
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.
I created a simple project of WPF based on the described scenario.
In the sample project, user navigates to another page by clicking a UXNavigationButton. It navigates using Command and CommandParameter which is provided from ViewModel. In the ViewModel, the object is passed as ExtraData.
Next, in the next ViewModel, the ExtraData is obtained from the NavigatedCommand property.
For more detail information, please kindly check the attached sample.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname