private void btnAdd_Click(object sender, RoutedEventArgs e) { AddEditReaderWin addEditReaderWin = new AddEditReaderWin(); this.Opacity = 0.5; addEditReaderWin.ShowDialog(); this.Opacity = 1; ListReader.ItemsSource = context.Reader.ToList(); HideViewBar(); }
private void btnChange_Click(object sender, RoutedEventArgs e) { if (ListReader.SelectedItem is Reader selectedreader) { AddEditReaderWin addEditReaderWin = new AddEditReaderWin(selectedreader); this.Opacity = 0.5; addEditReaderWin.ShowDialog(); this.Opacity = 1; HideViewBar(); } else { MessageBox.Show("Запись не выбрана", "Внимание", MessageBoxButton.OK, MessageBoxImage.Information); } ListReader.ItemsSource = context.Reader.ToList(); }