
Ergebnis 1 bis 3 von 3
-
Bin hier zuhause
- 16.11.2011, 20:09
- #1
Hallo,
ich möchte gerne eine Variable deklarieren bei der ich von jeder Page zugreifen kann. Ich habe mal irgendwo gelesen das man in der App.xaml.vb was reinschreiben muss.
Hier habt ihr mal ein Zitat aus dem AppHub Forum von einem User:
Use basic C# language concepts (nothing special about the phone or app.xaml.cs). The simplest way is to define a public static variable in any public class (e.g. [FONT=courier new]public static int MyGlobalInt;[/FONT] in the App class in App.xaml.cs), then you can access it anywhere in the app with [FONT=courier new]App.MyGlobalInt[/FONT]. For something accessible throughout the app, it usually makes sense to put a global inside the App class, but you can really put it in any class you want (e.g. MainPage) and access it with classname.GlobalVariableName. Er erklärt es für C# aber es ist ja ähnlich, vielleicht kann jemand damit was anfangen.
-
Gehöre zum Inventar
- 16.11.2011, 20:22
- #2
Ich hab mal diese Seite hier bemüht: http://www.developerfusion.com/tools.../csharp-to-vb/
Die hat mir aus: public static int GlobalInt;
das hier gezaubert: Public Shared GlobalInt As Integer
Kann selbst nur C# und kein VB.Net aber scheint mir als Übersetzung zu passen.
-
Bin hier zuhause
- 16.11.2011, 20:35
- #3
Vielen Dank! Es funktioniert!
Ähnliche Themen
-
Microsoft plant globale Werbekampagne
Von Vogelmensch im Forum Windows Phone 7 AllgemeinAntworten: 48Letzter Beitrag: 07.11.2011, 17:44 -
Zwischen zwei Seiten zwei Variablen übermitteln
Von Schledi im Forum Windows Phone 7 EntwicklungAntworten: 3Letzter Beitrag: 29.04.2011, 12:25 -
variablen inhalte speichern
Von cyda im Forum Windows Phone 7 EntwicklungAntworten: 14Letzter Beitrag: 09.03.2011, 07:41 -
Zugangspunkt definieren
Von Unregistriert im Forum Google Nexus OneAntworten: 1Letzter Beitrag: 27.01.2010, 08:51 -
variablen Problem
Von evbnoob im Forum ProgrammierenAntworten: 1Letzter Beitrag: 24.03.2004, 15:13
Pixel 10 Serie mit Problemen:...