//Button click executes AddProduct method. private void Btn_Confirm(object sender, RoutedEventArgs e) { //Validation for Product properties. if (ValidateProduct.Validate(apvm.Product)) { apvm.AddProduct(); ManagerWindow window = new ManagerWindow(); window.Show(); this.Close(); } }
public async void Execute(object parameter) { var product = parameter as Product; _viewModel.AddProduct(product); }