private void Edit([NotNull] object sender, [NotNull] RoutedEventArgs e) { Debug.ArgumentNotNull(sender, nameof(sender)); Debug.ArgumentNotNull(e, nameof(e)); var selectedItem = CheckList.SelectedItem as ListBoxItem; if (selectedItem == null) { return; } var customValidation = selectedItem.Tag as CustomValidation; if (customValidation == null) { Trace.Expected(typeof(CustomValidation)); return; } var d = new EditCustomValidationDialog(customValidation); if (AppHost.Shell.ShowDialog(d) != true) { return; } CustomValidationManager.Update(customValidation); selectedItem.Content = customValidation.Title; EnableButtons(); }
private void Add([NotNull] object sender, [NotNull] RoutedEventArgs e) { Debug.ArgumentNotNull(sender, nameof(sender)); Debug.ArgumentNotNull(e, nameof(e)); var customValidation = new CustomValidation(); var d = new EditCustomValidationDialog(customValidation); if (AppHost.Shell.ShowDialog(d) != true) { return; } CustomValidationManager.Add(customValidation); CheckList.SelectedIndex = Refresh(customValidation); EnableButtons(); }