private void ButtonAddStop(object sender, RoutedEventArgs e) { Лекарство a = new Лекарство(); AddDrug addDrug = new AddDrug(model, a); addDrug.ShowDialog(); DataGrid.SelectedItem = a; }
private void Edit_Click(object sender, RoutedEventArgs e) { Лекарство a = DataGrid.SelectedItem as Лекарство; using (CollectionViewSource.GetDefaultView(Drugss).DeferRefresh()) { AddDrug addDrug = new AddDrug(model, a) { Owner = this }; addDrug.ShowDialog(); } }