Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 windows phone 8.1 sliverlight 的应用程序级别定义了一些属性。现在我想从任何页面获取 app.xaml.cs 的对象,就像我们可以在 android 中获取应用程序类一样。如果有人知道,请告诉我。
如果我没记错的话,App 类是静态的,这意味着你可以像这样在你的页面中调用它
App.MyProperty
只要确保你让你的财产static
static
如果您有很多想要访问的东西,只需创建一个新的静态类并在那里添加所有内容,就像我上面提到的那样