1

I've got a MainPage.xaml page a Detail.xaml page.

I've passed variables to the Detail.xaml from MainPage.xaml by using a static variable and referencing it in Detail.xaml (the detail page is acting like a dialog). However once I've updated the content of another object, I want to call a method in MainPage.xaml to refresh the content of that page using the updated object from the Detail.xaml page.

I assume I am not using the correct paradigm for this and should probably be using MVVM or something but I'm not familiar with the implementation and was hoping there was a simple way to do this?

Sebastian Gray
  • 2,590
  • 3
  • 26
  • 36
  • Hi Sebastian, It might help if we can see a bit more detail such as how your getting data into into your main page controls and whether your referencing the same instance of data in your second page as main page.. ie how are you passing this if using a static that's accessible on both pages anyway. – Mick N Jan 09 '11 at 03:39
  • The Details.xaml page just assumes there is a value in the static variable. It's not really passing anything to the Details.xaml page but when it loads it just requires a value in the static variable. Once I've completed updating the object I just want to call a variable on MainPage.xaml in the cs file called UpdatePage() which will then just update the content based on the static variable. Does that make more sense? – Sebastian Gray Jan 09 '11 at 03:42
  • Best solution IMO: http://stackoverflow.com/questions/4701566/passing-a-complex-object-to-a-page-while-navigating-in-a-wp7-silverlight-applica/15536127#15536127 – radsdau Mar 20 '13 at 22:43
  • Best solution IMO: http://stackoverflow.com/questions/4701566/passing-a-complex-object-to-a-page-while-navigating-in-a-wp7-silverlight-applica/15536127#15536127 – radsdau Mar 20 '13 at 22:55

1 Answers1

1

Can you load the content from the static into your control in the OnNavigatedTo?

You can make a method in your main page to do that job and call that.

Mick N
  • 14,892
  • 2
  • 35
  • 41