private void NewPruduct_OnClick(object sender, RoutedEventArgs e) { var newProduct = new NewProduct(); newProduct.ShowDialog(); productsGrid.ItemsSource = GetGridData(); }
private void ProductsGrid_OnRowClick(object sender, RoutedEventArgs e) { var dataRow = (DataGridRow)sender; if (!(dataRow.Item is Medicine)) { return; } var medicine = (Medicine)dataRow.Item; var newProduct = new NewProduct(); newProduct.Init(medicine); newProduct.ShowDialog(); productsGrid.ItemsSource = GetGridData(); }