public void removeItem(object sender) { if (!(sender is movieItem)) { return; } movieItem movieItemSender = sender as movieItem; string movieName = movieItemSender.movieName.Text; XElement xmlFile = XElement.Load("moviesList.xml"); (from m in xmlFile.Elements() where m.Element("name").Value == movieName select m).FirstOrDefault().Remove(); xmlFile.Save("moviesList.xml"); movieItem temp = null; Master wnd = (Master)Window.GetWindow(this); mainPage mp = (mainPage)wnd.mainFrame.Content; foreach (movieItem item in mp.listView.Items) { if (item.movieName.Text == movieName) { temp = item; break; } } if (temp != null) { mp.listView.Items.Remove(temp); } }
private void label_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Master wnd = (Master)Window.GetWindow(this); mainPage nmp = (mainPage)wnd.mainFrame.Content; nmp.textBox.Text = label.Content.ToString(); }
private void animate8_Completed(object sender, EventArgs e) { Master wnd = (Master)Window.GetWindow(this); if (wnd != null) { mainPage nmp = (mainPage)wnd.mainFrame.Content; if (nmp != null) { animation.BeginAnimation(Ellipse.MarginProperty, null); } } ThicknessAnimation animate = new ThicknessAnimation(new Thickness(0), new Thickness(500, 0, -500, 0), TimeSpan.FromMilliseconds(300), FillBehavior.HoldEnd); animate.Completed += new EventHandler(animate1_Completed); ellipse_4.BeginAnimation(Ellipse.MarginProperty, animate); }