private void lsvCope_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (lsvCope.SelectedValue != null) { _selectedCope = lsvCope.SelectedValue as Cope; DataContext = _selectedCope; } }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (_allCopes.Count(x => x.Name == _selectedCope.Name) == 0 && !string.IsNullOrEmpty(_selectedCope.Name)) { _selectedCope.Id = 0; _repo.InsertItem <Cope>(_selectedCope); GetAllCopes(); _selectedCope = new Cope(); } }