I have been using the NavigationService
\'s Navigate
method to navigate to other pages in my WP7 Silverlight app:
NavigationService.
Debatable solution, if anything, make it temporary.
Create this under the namespace of your application for whichever page necessary.
public static class VarsForPages {
// Be sure to include public static.
public static SomeClass SomeClassObject;
public static List SomeList = new List();
public static string SomeData = "SomeValue";
}
// The syntax for referencing the data
VarsForPages.SomeClassObject;
VarsForPages.SomeList;
VarsForPages.SomeData;
Now you can reference SomeClassObject, SomeList, SomeData anywhere in the application.
Note: Like any global data, be weary of the many accesses & modifications which may be done to the global data. I say this, because I once had a list increase in size, but one of my pages in the application relied on the size of the list to be of some value, and this caused a bug. Don't forget, the data is global.