Skip to content

Commit 78991fe

Browse files
committed
Tweaks to the OnPropertyChanging overloads
1 parent 2f71694 commit 78991fe

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,36 @@ public abstract class ObservableObject : INotifyPropertyChanged, INotifyProperty
2727
public event PropertyChangingEventHandler? PropertyChanging;
2828

2929
/// <summary>
30-
/// Performs the required configuration when a property has changed, and then
31-
/// raises the <see cref="PropertyChanged"/> event to notify listeners of the update.
30+
/// Raises the <see cref="PropertyChanged"/> event.
3231
/// </summary>
33-
/// <param name="args">The input <see cref="PropertyChangedEventArgs"/> instance.</param>
34-
protected void OnPropertyChanged(PropertyChangedEventArgs args)
32+
/// <param name="e">The input <see cref="PropertyChangedEventArgs"/> instance.</param>
33+
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
3534
{
36-
PropertyChanged?.Invoke(this, args);
35+
PropertyChanged?.Invoke(this, e);
3736
}
3837

3938
/// <summary>
40-
/// Performs the required configuration when a property is changing, and then
41-
/// raises the <see cref="PropertyChanged"/> event to notify listeners of the update.
39+
/// Raises the <see cref="PropertyChanging"/> event.
4240
/// </summary>
43-
/// <param name="args">The input <see cref="PropertyChangingEventArgs"/> instance.</param>
44-
protected void OnPropertyChanging(PropertyChangingEventArgs args)
41+
/// <param name="e">The input <see cref="PropertyChangingEventArgs"/> instance.</param>
42+
protected virtual void OnPropertyChanging(PropertyChangingEventArgs e)
4543
{
46-
PropertyChanging?.Invoke(this, args);
44+
PropertyChanging?.Invoke(this, e);
4745
}
4846

4947
/// <summary>
50-
/// Performs the required configuration when a property has changed, and then
51-
/// raises the <see cref="PropertyChanged"/> event to notify listeners of the update.
48+
/// Raises the <see cref="PropertyChanged"/> event.
5249
/// </summary>
5350
/// <param name="propertyName">(optional) The name of the property that changed.</param>
54-
/// <remarks>The base implementation only raises the <see cref="PropertyChanged"/> event.</remarks>
5551
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
5652
{
5753
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
5854
}
5955

6056
/// <summary>
61-
/// Performs the required configuration when a property is changing, and then
62-
/// raises the <see cref="PropertyChanged"/> event to notify listeners of the update.
57+
/// Raises the <see cref="PropertyChanging"/> event.
6358
/// </summary>
6459
/// <param name="propertyName">(optional) The name of the property that changed.</param>
65-
/// <remarks>The base implementation only raises the <see cref="PropertyChanging"/> event.</remarks>
6660
protected virtual void OnPropertyChanging([CallerMemberName] string? propertyName = null)
6761
{
6862
PropertyChanging?.Invoke(this, new PropertyChangingEventArgs(propertyName));

0 commit comments

Comments
 (0)