Global variables Xamarin

Asked

Viewed 419 times

4

Is it possible for me to create modules to add global variables in Xamarin? how I could create variables that can be accessed from anywhere?

  • 1

    Putz I was doing wrong, vlw bro hugs.

2 answers

3


Declare a static class within the module App.xaml.cs and declare global as their fields.

Example:

public static class Globais
{
    public static string Aplicativo = "teste de globais";
    public static int Identificador = 33;
}

2

Now how do I put this topic as solved? rsrs

class ConfigSQL
{
    private static Int32 _index = 0;
    public static Int32 index
    {
        get { return _index; }
        set { _index = value; }
    }
 }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.