JTIM
JTIM

Reputation: 2771

Share Objects and Information between projects

I am making a windows phone application, and have divided my solution up in 4 projects.

I share models between all projects using the Portable Library. But how to share information, I know I can share variables and other elements using Uri Scheme:

NavigationService.Navigate(new Uri("/Project;component/URI.xaml", UriKind.Relative));

But what if I want to parse Complex objects?

An Example with pseudo code and program flow:

**STARTUP->MainProject**
UILoad();                     //Login UI shown
MobileService.Authenticate(); //Authentication stored in Isolated storage through CreditVault.
NavigateTo->MainMenu();       //

**MainMenu->SecondaryProject**
NavigationService.Navigate(new Uri("/SecondaryProject;component/URI.xaml", UriKind.Relative)); 
MobileService.AccessRestrictedInformation(); //How to still be authenticated here?
SavePictureAndInformation();  //How to make Information available to all projects in the solution?

The authentication I have on the startupPage, allows me to automatically re-authenticate users, which is why I store it encrypted.

Questions

Can the other Project access the IsolatedStorage of the first project, if so how?

If I authenticate the user upon startup, will a created mobileservice in another project within the solution also be authenticated?

Am I missing somethine smart?

External Information

I need the setup of multiple projects with pages and cannot insert them in the same project. So it is not a solution to have it in the same project.

Upvotes: 1

Views: 339

Answers (1)

JTIM
JTIM

Reputation: 2771

You can share information between projects using IsolatedStorage or use the application.current.resources, from this link http://mikaelkoskinen.net/windows-phone-pass-data-between-pages-application-resources/

Hope somebody find it useful :)

Upvotes: 1

Related Questions