1

I haven't found any useful answer, or should I say "any answer" that how can I pass data objects between the pages in WP7?

PAGE1

IEnumerable<dictParts> Parts = LoadParts();

How can I pass Parts to PAGE2?

wafers
  • 1,149
  • 4
  • 14
  • 34

1 Answers1

2

See also How to pass a value between Silverlight pages for WP7?

You have a couple of options:

  • Serialize the data and pass it on the querystring of the Navigate() request.
  • Store the data in a global variable that is accessible from both pages (like the MVVM pattern).
Community
  • 1
  • 1
gbanfill
  • 2,216
  • 14
  • 21
  • 1
    It can be done by using global variable public static class GlobalVariables { public static string my_string = ""; public static int my_int = -1; } Then you access the Global Variables class like this: GlobalVariables.variable_name e.g. `GlobalVariables.my_string`; Ref: http://forums.create.msdn.com/forums/p/66396/573232.aspx – wafers Apr 04 '12 at 18:54
  • Be sure you are careful about memory leaking (i.e. - you may want to nullify the object when you go back from the page.) – Shahar Prish Apr 04 '12 at 20:24