private void IzmenaSirovine(object sender, RoutedEventArgs e) { if (dgSirovine.SelectedItem != null) { WinAESirovina waes = new WinAESirovina(lstSirovina.ToList()); waes.Owner = this; waes.DataContext = dgSirovine.SelectedItem; waes.ShowDialog(); } }
private void DodavanjeSirovine(object sender, RoutedEventArgs e) { WinAESirovina waes = new WinAESirovina(lstSirovina.ToList()); waes.Owner = this; if (waes.ShowDialog() == true) { lstSirovina.Add(waes.DataContext as clsSirovina); } }