Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 917
MilkBottle Avatar asked Aug 23 '11 00:08

MilkBottle


1 Answers

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!

like image 195
alf Avatar answered Nov 15 '22 09:11

alf