private void Button_Click(object sender, RoutedEventArgs e) { if (isAddWindow) { viewModel.AddOrder(); } else { viewModel.EditOrder(); } this.Close(); }