/// <summary> /// Add client and switching to an another window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NextButton_Click(object sender, RoutedEventArgs e) { try { // first checking if the client is eligibe to perfom order if (bl.isEligibedForOrder(client)) { // calling function bl.AddClient(client); // reinitialize data client = new Client(); this.DataContext = client; // switching window Switcher.Switch(new NewOrderWindow()); } } // catch excpetion catch (Exception ex) { MessageBox.Show(ex.Message); } }