简体   繁体   中英

Share Objects and Information between projects

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

  • WebService
  • MainProject
  • SecondaryProject
  • PortableLibrary

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.

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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM