public MainWindow(Mutex mutex, DatabaseContext_Main db, Service_JsonParser jsonParser,
                          NamedPipeManager npm, List <DatabaseContext_Profile> profiles, ProfilesManager profMngr, Nexus.NexusUrl modUri = null)
        {
            InitializeComponent();

            _mutex            = mutex;
            _jsonParser       = jsonParser;
            _db               = db;
            _dbProfiles       = profiles;
            _currProfileDb    = _dbProfiles.FirstOrDefault(x => _currGame.Id == x.GameId);
            _namedPipeManager = npm;
            _profilesManager  = profMngr;
            _mulConverter     = new MultiplicationMathConverter();
            _addConverter     = new AdditionMathConverter();

            _namedPipeManager.ChangeMessageReceivedHandler(HandlePipeMessage);

            mainGrid.Dispatcher.BeginInvoke((Action)(() =>
            {
                InitGamePicker();
                _accountHandler = new AccountHandler(WhenLogsIn);
                _accountHandler.Init();
                _modManager = new ModManager(_currProfileDb, ModList_View, Downloads_View, _accountHandler);
                profilePicker.SelectionChanged += profilePicker_SelectionChanged;

                if (modUri != null)
                {
                    _modManager.CreateMod(_currGame, modUri).GetAwaiter();
                }
                _db.UpdateCurrentGame(_currGame, SetGame);
            }));

            if (!_namedPipeManager.IsRunning)
            {
                Task.Run(async() => await _namedPipeManager.Listen_NamedPipe(Dispatcher));
            }
        }