如何引用属性,全局变量在应用程序从其他页的Windows Phone [英] How to reference properties, global variable in app from other page for windows phone

查看:135
本文介绍了如何引用属性,全局变量在应用程序从其他页的Windows Phone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

明白,在App.Xaml.cs,我可以创建全局变量和属性。如何从其他页面引用它们? 。ITIS IKE应用...什么

understand that in App.Xaml.cs, I can create global variable and properties. How do I reference them from other page?? Itis ike App... something.

推荐答案

使用:

(App)App.Current 

您也可以创建这个属性在App类,所以你不必每次施放它:

You can also create this property in your App class, so you don't have to cast it everytime:

public static new App Current
{
    get { return Application.Current as App; }
}

通过这个属性定义,您可以参考您的应用程序只需用 App.Current

With this property defined, you can reference your app just with App.Current

希望它帮助!

这篇关于如何引用属性,全局变量在应用程序从其他页的Windows Phone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆