I have an object which i am using almost all windows phone pages, currently i am using via
PhoneApplicationService.Current.State["xx"] = m_xx;
NavigationService.Navigate(new Uri("/abc.xaml", UriKind.Relative));
but this has to be done for all activities, which i don't want. is there a better way to save m_xx object which i can use in all the pages? what is the best practice?
Can i make object static to some class and then use across pages via that class name?
You might want to look into the MVVM pattern.
Still, if it's too much a change for your application, you can use a hybrid approach, with a shared context stored in a static property.
First, create a Context class and put your shared properties inside:
Then, in the App.xaml.cs, create a static property to store the context:
Then, from anywhere in your application, you can access your context to store/retrieve data: