private void CreateButton_Click(object sender, RoutedEventArgs e) { if (PlaylistNameField.Text.Replace(" ", "").Length == 0) { MessageBox.Show("Cannot make a nameless playlist"); return; } if (NewPlaylistEvent != null) { var playlist = new Playlist(PlaylistNameField.Text); NewPlaylistEvent.Invoke(playlist); } this.Close(); }
private void GetPlayList_DoubleClick(object sender, MouseButtonEventArgs e) { if (NewPlaylistEvent != null) { if (collection == null || collection.Count == 0) { return; } //get selected item var item = ((FrameworkElement)e.OriginalSource).DataContext as Playlist; if (item != null) { NewPlaylistEvent.Invoke(item); DialogResult = true; } } }