/// <summary> /// Introduces a set of steps that mimic setting a property with event notification. /// </summary> /// <typeparam name="TValue">The type of the property.</typeparam> /// <param name="caller">The mock or step to which this 'stored' step is added.</param> /// <param name="propertyChangedEvent">The event step used to store <see cref="PropertyChangedEventHandler" /> instances.</param> /// <param name="initialValue">The initial value of the property.</param> /// <param name="comparer"> /// An optional comparer used to determine if the value of the property has changed. An event will /// only be raised if it has. /// </param> /// <returns>An <see cref="ICanHaveNextPropertyStep{TValue}" /> that can be used to add further steps.</returns> public static IStoredProperty <TValue> StoredWithChangeNotification <TValue>( this ICanHaveNextPropertyStep <TValue> caller, IStoredEvent <PropertyChangedEventHandler> propertyChangedEvent, TValue initialValue = default, IEqualityComparer <TValue>?comparer = null) { return(caller .OnlySetIfChanged(comparer) .RaisePropertyChangedEvent(propertyChangedEvent) .Stored(initialValue)); }