private async void Create(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(PlaylistTextBox.Text)) { Core.WinRt.Common.ToastManager.ShowError("Enter a name."); } else { if (App.Locator.CollectionService. Playlists.FirstOrDefault(p => string.Equals(p.Name, PlaylistTextBox.Text, StringComparison.CurrentCultureIgnoreCase)) != null) { PlaylistTextBox.Text = ""; Core.WinRt.Common.ToastManager.ShowError("Already exists."); } else { var playlist = await App.Locator.CollectionService.CreatePlaylistAsync(FirstCharToUpper(PlaylistTextBox.Text)); SheetUtility.CloseAddAPlaylistPage(); } } }
private void Close(object sender, RoutedEventArgs e) { SheetUtility.CloseAddAPlaylistPage(); }