0

I am working on a WPF project which is having multiple pages, and I have to pass multi-variable data b/w pages. Now the technique I am using to pass data is; I have created a model class for those variable as given below;

 public class CAR
 {
      public string MODEL;
      public string BRAND;
      public string COLOR;
 }

And when I navigate to the next page i pass the above model class object to page as given below;

{
    CAR cr1 = new CAR();
    //Assign values to cr1
    Page2 pg = new Page2(cr1);
    NavigationService.Navigate(pg);
}

Now my question is, am I following the standard way of passing data b/w pages? or there is some other proper way to pass multi-variable data. kindly guide me

WiXXeY
  • 981
  • 5
  • 19
  • 46
  • typically wpf works with DataContexts instead of passing as variable which tightly couples the viewmodel types with the view. for more info on data context read this http://stackoverflow.com/questions/15681352/transitioning-from-windows-forms-to-wpf – pushpraj Jun 06 '14 at 07:15
  • possible duplicate of [Transitioning from Windows Forms to WPF](http://stackoverflow.com/questions/15681352/transitioning-from-windows-forms-to-wpf) – pushpraj Jun 06 '14 at 07:16

0 Answers0