开发者

How to reference properties, global variable in app from other page for windows phone

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


Use:

(App)App.Current 

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; }
}

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

Hope it helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜