简体   繁体   English

我希望有一个页面可以从用户那里收集信息,并且我想获取这些信息并在其他页面和类上使用它

[英]I want to have a page that collects information from the user, and i want to take that information and use it on other pages and classes

是否有必要将其存储到文件和隔离存储中,或者有其他方法可以做到这一点?

No, you do not have to. 不,您不必。 You can place common data in your 'application', which will be accessible everywhere via the Application.Current property. 您可以在“应用程序”中放置通用数据,可以通过Application.Current属性在任何地方访问它们。 Alternatively, if you use the MVVM pattern, you can set the DataContext of the RootFrame , this will ensure that all pages shares the same data context. 另外,如果您使用MVVM模式,则可以设置RootFrameDataContext ,这将确保所有页面共享相同的数据上下文。

See this blog post I wrote for a nice simple MVVM WP7 example . 请参阅我写的博客文章,其中提供了一个很好的简单MVVM WP7示例

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想从SQLite DB中获取所有信息 - I want to take all the information from SQLite DB 如何在视图中使用来自多个类(表)的信息? - How can I use information from multiple classes (tables) in a view? 除非我关闭我的表单,否则我的代码不会运行,但是我需要打开我的表单,因为我想显示来自其他代码的信息 - My code won't run unless I close my form, however I need my form to be open as I want to display information from other code 我想使用字体信息作为属性值将pdf导出到xml - I want to export pdf to xml with font information as attribute values C#dataGridView不显示我想要显示的信息 - C# dataGridView doesnt show information I want it to show 想要从一种形式获取数据以将它们用作另一种形式的变量 - Want to take data from one form to use them as variable in an other 我想通过使用C#语言(Windows窗体)从Facebook获取用户信息和分析。 - I want to get users information and Analyse from facebook ,by using C# language (windows form) 我希望用户能够下载页面 - I want the user to be able to download a page 我如何获取linq收到的信息,并在if else语句中使用该信息? - How can I take the information I received with linq and use that information in an if else statement? 当我只希望某些派生类可以访问基础 class 中的方法时,使用什么设计模式? - What design pattern to use when I want only some derived classes to have access to a method in base class?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM