private void CreatePlayList(string playListName, bool addToTabsRegion = false) { PlaylistTabViewModel vm = null; if (!PlayListViewModels.Any(x => x.TabHeader == playListName)) { vm = ResolveNewTabModelFromContainer(); vm.TabHeader = playListName; PlayListViewModels.Add(vm); Log($"Created playlist - {playListName}"); } if (addToTabsRegion) { Log("Adding to tab region"); OpenPlayListViewModels.Add(vm); _lastOpenedTab = vm; } }
private async void OnOpenPlaylist(PlaylistTabViewModel playlistTabViewModel) { try { if (!OpenPlayListViewModels.Any(x => x == playlistTabViewModel)) { Log($"Opening existing: {playlistTabViewModel.Playlist?.Name}", Category.Debug); OpenPlayListViewModels.Add(playlistTabViewModel); await OnViewLoaded(playlistTabViewModel); } else if (playlistTabViewModel?.Playlist?.Id == 0) { Log("Adding a not saved playlist"); OpenPlayListViewModels.Add(playlistTabViewModel); } SelectedTab = playlistTabViewModel; } catch (System.Exception ex) { Log(ex.Message, Category.Exception); } }