Home > Mobile >  How to acces static dictionary from a class in MainWindow
How to acces static dictionary from a class in MainWindow

Time:09-02

I want to check if the first textbox matches for example "Tom" and the second textbox matches 1234. I can't figure out how to call the dictionary to the mainwindow. If anyone could help me out, let me know! :)

      public static class Wachtwoorden
{
    static readonly Dictionary<string, string> dictionary
        = new Dictionary<string, string>
        {
        {"Tom","1234" },
        {"Jan", "8765"},
        {"Piet","5678"},
        {"Dirk", "4321"}
            };
}

CodePudding user response:

In order to access it from any other class, you will have to make it public. ^^

  • Related