Show / Hide Table of Contents

Class NotifyPropertyChangeBaseExtensions

Includes extensions for any object that inherits the NotifyPropertyChangeBase class.

Inheritance
object
NotifyPropertyChangeBaseExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.Mvvm.dll
Syntax
public static class NotifyPropertyChangeBaseExtensions

Methods

| Edit this page View Source

Subscribe<T>(T, Expression<Func<T, object?>>, PropertyChangeObserver)

Subscribes a delegate to be executed when a specific property changes its value.

Declaration
public static void Subscribe<T>(this T instance, Expression<Func<T, object?>> propertySelector, PropertyChangeObserver callback) where T : NotifyPropertyChangeBase
Parameters
Type Name Description
T instance

Instance onto which to add the subscription.

Expression<Func<T, object>> propertySelector

Expression that selects the property to subscribe the action for.

PropertyChangeObserver callback

Action to execute when the property changes its value.

Type Parameters
Name Description
T

Type of object to select the observed property from.

| Edit this page View Source

Unsubscribe<T>(T, Expression<Func<T, object?>>)

Removes all previously subscribed actions for the specified property.

Declaration
public static bool Unsubscribe<T>(this T instance, Expression<Func<T, object?>> propertySelector) where T : NotifyPropertyChangeBase
Parameters
Type Name Description
T instance

Instance from which to remove the subscription.

Expression<Func<T, object>> propertySelector

Expression that selects the property to unsubscribe the previously subscribed actions for.

Returns
Type Description
bool
Type Parameters
Name Description
T
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX