/// <summary> /// Adds a new library to the current selected game. /// </summary> private void AddNewLibrary() { Task.Run(() => { try { AccessTokens accessTokens = SettingsViewModel.GetInstance().AccessTokens; Library newLibrary = SqualrApi.CreateLibrary(accessTokens?.AccessToken, this.SelectedGame.GameId); this.libraries.Add(newLibrary); this.RaisePropertyChanged(nameof(this.Libraries)); } catch (Exception ex) { OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Error, "Error creating library", ex); } }); }