protected void InitializeMainWindow()
 {
     if (_mainWindow == null)
     {
         _mainWindow = new MainWindow();
         _mainWindow.Width = Settings.CollectionWindowWidth;
         _mainWindow.Height = Settings.CollectionWindowHeight;
         _mainWindow.Filter.OnlyMissing = !Settings.DefaultShowAllCards;
         _mainWindow.Closed += (sender, args) =>
         {
             Settings.CollectionWindowWidth = _mainWindow.Width;
             Settings.CollectionWindowHeight = _mainWindow.Height;
             if (_mainWindow.Filter != null)
             {
                 Settings.DefaultShowAllCards = !_mainWindow.Filter.OnlyMissing;
             }
             _mainWindow = null;
         };
     }
 }