public void EditInfo(object sender, MouseButtonEventArgs e) { if (WindowEdit != null) { WindowEdit.Close(); } string id = vieModel.DetailMovie.id; Console.WriteLine(id); WindowEdit = new WindowEdit(id); WindowEdit.Loaded += delegate(object _sender, RoutedEventArgs args) { if (WindowEdit.IdListBox.Items.Count > 0) { for (int i = 0; i <= WindowEdit.IdListBox.Items.Count - 1; i++) { string movieid = WindowEdit.IdListBox.Items[i].ToString(); if (movieid.ToLower() == id.ToLower()) { WindowEdit.IdListBox.SelectedItem = WindowEdit.IdListBox.Items[i]; WindowEdit.IdListBox.ScrollIntoView(WindowEdit.IdListBox.Items[i]); break; } } } }; WindowEdit.Show(); }
private void InsertOneMovie(object sender, RoutedEventArgs e) { WindowEdit windowEdit = null; Window window = Jvedio.GetWindow.Get("WindowEdit"); if (window != null) { windowEdit = (WindowEdit)window; windowEdit.Close(); } windowEdit = new WindowEdit(); windowEdit.Show(); }