/// <summary> /// First init /// </summary> private void Init() { // Set rpogramstate to running ProgramState.IsRunning = true; // Read the config files on startup ConfigFileHelpers.ReadServerConfigFile(); // Try to connect to the server Task.Run(async() => { await ProgramState.ServerConnection.ConnectAsync(); await DatabaseHelpers.Init(); }); // Set the current screen CurrentScreen = MainPages.WellcomeScreen; // The await does not work for some f****** reason! while (DatabaseHelpers.AllProducts == null) { ; } // Set this VM VM = this; }