Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Microsoft.Toolkit.Mvvm/ComponentModel/ObservableObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ protected bool SetProperty<T>(T oldValue, T newValue, IEqualityComparer<T> compa
/// <typeparam name="T">The type of property (or field) to set.</typeparam>
/// <param name="oldValue">The current property value.</param>
/// <param name="newValue">The property's value after the change occurred.</param>
/// <param name="model">The model </param>
/// <param name="model">The model containing the property being updated.</param>
/// <param name="callback">The callback to invoke to set the target property value, if a change has occurred.</param>
/// <param name="propertyName">(optional) The name of the property that changed.</param>
/// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
Expand All @@ -236,6 +236,7 @@ protected bool SetProperty<T>(T oldValue, T newValue, IEqualityComparer<T> compa
/// raised if the current and new value for the target property are the same.
/// </remarks>
protected bool SetProperty<TModel, T>(T oldValue, T newValue, TModel model, Action<TModel, T> callback, [CallerMemberName] string? propertyName = null)
where TModel : class
{
if (EqualityComparer<T>.Default.Equals(oldValue, newValue))
{
Expand Down Expand Up @@ -263,11 +264,12 @@ protected bool SetProperty<TModel, T>(T oldValue, T newValue, TModel model, Acti
/// <param name="oldValue">The current property value.</param>
/// <param name="newValue">The property's value after the change occurred.</param>
/// <param name="comparer">The <see cref="IEqualityComparer{T}"/> instance to use to compare the input values.</param>
/// <param name="model">The model </param>
/// <param name="model">The model containing the property being updated.</param>
/// <param name="callback">The callback to invoke to set the target property value, if a change has occurred.</param>
/// <param name="propertyName">(optional) The name of the property that changed.</param>
/// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
protected bool SetProperty<TModel, T>(T oldValue, T newValue, IEqualityComparer<T> comparer, TModel model, Action<TModel, T> callback, [CallerMemberName] string? propertyName = null)
where TModel : class
{
if (comparer.Equals(oldValue, newValue))
{
Expand Down
2 changes: 2 additions & 0 deletions Microsoft.Toolkit.Mvvm/ComponentModel/ObservableRecipient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ protected bool SetProperty<T>(T oldValue, T newValue, IEqualityComparer<T> compa
/// <param name="propertyName">(optional) The name of the property that changed.</param>
/// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
protected bool SetProperty<TModel, T>(T oldValue, T newValue, TModel model, Action<TModel, T> callback, bool broadcast, [CallerMemberName] string? propertyName = null)
where TModel : class
{
bool propertyChanged = SetProperty(oldValue, newValue, model, callback, propertyName);

Expand Down Expand Up @@ -288,6 +289,7 @@ protected bool SetProperty<TModel, T>(T oldValue, T newValue, TModel model, Acti
/// <param name="propertyName">(optional) The name of the property that changed.</param>
/// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
protected bool SetProperty<TModel, T>(T oldValue, T newValue, IEqualityComparer<T> comparer, TModel model, Action<TModel, T> callback, bool broadcast, [CallerMemberName] string? propertyName = null)
where TModel : class
{
bool propertyChanged = SetProperty(oldValue, newValue, comparer, model, callback, propertyName);

Expand Down
2 changes: 2 additions & 0 deletions Microsoft.Toolkit.Mvvm/ComponentModel/ObservableValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ protected bool SetProperty<T>(T oldValue, T newValue, IEqualityComparer<T> compa
/// <param name="propertyName">(optional) The name of the property that changed.</param>
/// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
protected bool SetProperty<TModel, T>(T oldValue, T newValue, TModel model, Action<TModel, T> callback, bool validate, [CallerMemberName] string? propertyName = null)
where TModel : class
{
if (validate)
{
Expand Down Expand Up @@ -199,6 +200,7 @@ protected bool SetProperty<TModel, T>(T oldValue, T newValue, TModel model, Acti
/// <param name="propertyName">(optional) The name of the property that changed.</param>
/// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
protected bool SetProperty<TModel, T>(T oldValue, T newValue, IEqualityComparer<T> comparer, TModel model, Action<TModel, T> callback, bool validate, [CallerMemberName] string? propertyName = null)
where TModel : class
{
if (validate)
{
Expand Down