Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeasureToolbar: modify ArgumentException message #539

Merged
merged 6 commits into from
Jan 5, 2024

Conversation

williambohrmann3
Copy link
Collaborator

When registering the DependencyPropertys for LineSketchEditor and AreaSketchEditor, they are both using the same method for the PropertyMetadata PropertyChangedCallback parameter. This is fine, but currently the exception message when the new value is null doesn't make sense for AreaSketchEditor. To remedy this, I would like to remove the unused method and modify the currently used method to make sense in both cases.

Also, I removed some redundant "using" statements and corrected a typo.

@williambohrmann3
Copy link
Collaborator Author

Any idea why the job might fail if the solution is building for me locally?

@williambohrmann3
Copy link
Collaborator Author

All resolved - updated the certificate for UWP, changes included in this PR.

Comment on lines 600 to 596
DependencyProperty.Register(nameof(LineSketchEditor), typeof(SketchEditor), typeof(MeasureToolbar), new PropertyMetadata(null, OnLineSketchEditorPropertyChanged));
DependencyProperty.Register(nameof(LineSketchEditor), typeof(SketchEditor), typeof(MeasureToolbar), new PropertyMetadata(null, OnSketchEditorPropertyChanged));

private static void OnLineSketchEditorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
private static void OnSketchEditorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? It's literally the 'LineSketchEditor' property. Please undo

@@ -631,26 +625,7 @@ private static void OnLineSketchEditorPropertyChanged(DependencyObject d, Depend
/// Identifies the <see cref="AreaSketchEditor"/> dependency property.
/// </summary>
public static readonly DependencyProperty AreaSketchEditorProperty =
DependencyProperty.Register(nameof(AreaSketchEditor), typeof(SketchEditor), typeof(MeasureToolbar), new PropertyMetadata(null, OnLineSketchEditorPropertyChanged));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only bug. It should call OnAreaSketchEditorPropertyChanged instead, and don't delete the code below.

@williambohrmann3 williambohrmann3 merged commit c076759 into main Jan 5, 2024
1 check passed
@williambohrmann3 williambohrmann3 deleted the wbohr/MeasureToolbar-PropertyChanged branch January 5, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants