private void shortcut_Click(object sender, RoutedEventArgs e) { AddStudent viewStudent = new AddStudent(); (this.Parent as Grid).Children.Add(viewStudent); (this.Parent as Grid).Children.Remove(this); }
private void Student_list_MouseDoubleClick(object sender, MouseButtonEventArgs e) { try { var sels = (student_list.SelectedItem as DataRowView)["reg_no"].ToString(); AddStudent adstud = new AddStudent(); adstud.stringaccmode(sels); (this.Parent as Grid).Children.Add(adstud); (this.Parent as Grid).Children.Remove(this); } catch (Exception) { //MessageBox.Show(ex.GetType().Name); } }