From 9849d88b7431278aa5e8dc315ab5108f1454046d Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 27 Sep 2020 15:28:16 +0200 Subject: [PATCH 1/2] Fixed two missing XML docs --- Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs b/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs index e1f2f36df6f..474dd77bda2 100644 --- a/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs +++ b/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs @@ -227,7 +227,7 @@ protected bool SetProperty(T oldValue, T newValue, IEqualityComparer compa /// The type of property (or field) to set. /// The current property value. /// The property's value after the change occurred. - /// The model + /// The model containing the property being updated. /// The callback to invoke to set the target property value, if a change has occurred. /// (optional) The name of the property that changed. /// if the property was changed, otherwise. @@ -263,7 +263,7 @@ protected bool SetProperty(T oldValue, T newValue, TModel model, Acti /// The current property value. /// The property's value after the change occurred. /// The instance to use to compare the input values. - /// The model + /// The model containing the property being updated. /// The callback to invoke to set the target property value, if a change has occurred. /// (optional) The name of the property that changed. /// if the property was changed, otherwise. From ceb016b9832c6ff860966876ca62ae4974c1f57e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 27 Sep 2020 15:38:40 +0200 Subject: [PATCH 2/2] Added missing generic argument constraint --- Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs | 2 ++ Microsoft.Toolkit.Mvvm/ComponentModel/ObservableRecipient.cs | 2 ++ Microsoft.Toolkit.Mvvm/ComponentModel/ObservableValidator.cs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs b/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs index 474dd77bda2..f1c9b8989b5 100644 --- a/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs +++ b/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs @@ -236,6 +236,7 @@ protected bool SetProperty(T oldValue, T newValue, IEqualityComparer compa /// raised if the current and new value for the target property are the same. /// protected bool SetProperty(T oldValue, T newValue, TModel model, Action callback, [CallerMemberName] string? propertyName = null) + where TModel : class { if (EqualityComparer.Default.Equals(oldValue, newValue)) { @@ -268,6 +269,7 @@ protected bool SetProperty(T oldValue, T newValue, TModel model, Acti /// (optional) The name of the property that changed. /// if the property was changed, otherwise. protected bool SetProperty(T oldValue, T newValue, IEqualityComparer comparer, TModel model, Action callback, [CallerMemberName] string? propertyName = null) + where TModel : class { if (comparer.Equals(oldValue, newValue)) { diff --git a/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableRecipient.cs b/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableRecipient.cs index c4ec80709ce..5a43d09aea4 100644 --- a/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableRecipient.cs +++ b/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableRecipient.cs @@ -257,6 +257,7 @@ protected bool SetProperty(T oldValue, T newValue, IEqualityComparer compa /// (optional) The name of the property that changed. /// if the property was changed, otherwise. protected bool SetProperty(T oldValue, T newValue, TModel model, Action callback, bool broadcast, [CallerMemberName] string? propertyName = null) + where TModel : class { bool propertyChanged = SetProperty(oldValue, newValue, model, callback, propertyName); @@ -288,6 +289,7 @@ protected bool SetProperty(T oldValue, T newValue, TModel model, Acti /// (optional) The name of the property that changed. /// if the property was changed, otherwise. protected bool SetProperty(T oldValue, T newValue, IEqualityComparer comparer, TModel model, Action callback, bool broadcast, [CallerMemberName] string? propertyName = null) + where TModel : class { bool propertyChanged = SetProperty(oldValue, newValue, comparer, model, callback, propertyName); diff --git a/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableValidator.cs b/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableValidator.cs index a1c20d82817..2a96ab7b837 100644 --- a/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableValidator.cs +++ b/Microsoft.Toolkit.Mvvm/ComponentModel/ObservableValidator.cs @@ -170,6 +170,7 @@ protected bool SetProperty(T oldValue, T newValue, IEqualityComparer compa /// (optional) The name of the property that changed. /// if the property was changed, otherwise. protected bool SetProperty(T oldValue, T newValue, TModel model, Action callback, bool validate, [CallerMemberName] string? propertyName = null) + where TModel : class { if (validate) { @@ -199,6 +200,7 @@ protected bool SetProperty(T oldValue, T newValue, TModel model, Acti /// (optional) The name of the property that changed. /// if the property was changed, otherwise. protected bool SetProperty(T oldValue, T newValue, IEqualityComparer comparer, TModel model, Action callback, bool validate, [CallerMemberName] string? propertyName = null) + where TModel : class { if (validate) {