void btn_MouseUp(object sender, MouseButtonEventArgs e) { RowDefinition rd = (RowDefinition)((Label)sender).Tag; rd.Height = new GridLength(0); try { ContentItem content_item = (ContentItem)rd.Tag; string file_name = content_item.ContentFile; Globals.DeleteFile(file_name); Contents.Remove(content_item); } catch { // } }
void RemoveItem_Click(object sender, RoutedEventArgs e) { MenuItem mi = (MenuItem)sender; RowDefinition rd = null; if (mi.Tag is Control) { ListOfContentControls.Remove((Control)mi.Tag); } if (mi.Tag is CtrlRoundImage) { rd = (RowDefinition)((CtrlRoundImage)mi.Tag).Tag; } else if (mi.Tag is CtrlRoundLabel) { rd = (RowDefinition)((CtrlRoundLabel)mi.Tag).Tag; } else if (mi.Tag is CtrlAudioPlayer) { CtrlAudioPlayer mp = (CtrlAudioPlayer)mi.Tag; mp.CloseStram(); rd = (RowDefinition)((CtrlAudioPlayer)mi.Tag).Tag; } else { return; } rd.Height = new GridLength(0); try { ContentItem content_item = (ContentItem)rd.Tag; string file_name = content_item.ContentFile; Globals.DeleteFile(file_name); Contents.Remove(content_item); } catch { // } }