[英]Share Objects and Information between projects
我正在制作Windows Phone應用程序,並將我的解決方案分為4個項目。
我使用可移植庫在所有項目之間共享模型。 但是如何共享信息,我知道我可以使用Uri Scheme共享變量和其他元素:
NavigationService.Navigate(new Uri("/Project;component/URI.xaml", UriKind.Relative));
但是,如果我想解析復雜對象怎么辦?
一個帶有偽代碼和程序流的示例:
**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?
我在startupPage上具有的身份驗證使我能夠自動重新身份驗證用戶,這就是為什么將其加密存儲的原因。
另一個項目可以訪問第一個項目的IsolatedStorage嗎?
如果我在啟動時對用戶進行身份驗證,是否還將對在解決方案中另一個項目中創建的移動服務進行身份驗證?
我想念一些聰明的東西嗎?
外部信息
我需要使用頁面設置多個項目,並且無法將它們插入同一項目中。 因此,將其包含在同一項目中不是解決方案。
您可以使用IsolatedStorage在項目之間共享信息,也可以通過以下鏈接使用application.current.resources http://mikaelkoskinen.net/windows-phone-pass-data-between-pages-application-resources/
希望有人覺得有用:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.