/// <summary> /// open the next window (adding child window) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Click_addChild(object sender, RoutedEventArgs e) { IEnumerable <Mother> mothers = myBl.MothersByPredicate(); // checks is there is untreated child. Because if there is no untreated child there is no point in opening this window if (mothers.Count() == 0) { MessageBox.Show("There is no any mother!", "Error 404", MessageBoxButton.OK, MessageBoxImage.Warning); return; } Window nextWindow = new AddChildWindow(); this.Close(); nextWindow.ShowDialog(); }
private void AddChildButton_Click(object sender, RoutedEventArgs e) { Window addchildwindow = new AddChildWindow(); addchildwindow.ShowDialog(); }