Show / Hide Table of Contents

Class ChangeTrackingObject

This class allows to determine whether there are any changes to it's properties.

Inheritance
object
ObservableObject
ChangeTrackingObject
ViewModelBase
Implements
INotifyPropertyChanged
IDataErrorInfo
INotifyDataErrorInfo
INotifyDataPropertyChanged
ObservableObject.PropertyChanged
ObservableObject.HasErrors
ObservableObject.AddError(IError)
ObservableObject.CascadeErrors()
ObservableObject.ClearErrors()
ObservableObject.ForceValidation<T>(string, T)
ObservableObject.GetEntityErrors()
ObservableObject.GetErrors(string)
ObservableObject.OnErrorsChanged(string)
ObservableObject.OnPropertyChanged(string)
ObservableObject.OnValidate(string)
ObservableObject.RemoveError(Guid)
ObservableObject.RemoveError(IError)
ObservableObject.SetValue<T>(string, ref T, T)
ObservableObject.SetValue<T>(string, ref T, T, IEqualityComparer<T>)
ObservableObject.SetValue<T>(string, ref T, T, Action<T>, Action<T>)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Infrastructure
Assembly: Sartorius.SAF.dll
Syntax
public abstract class ChangeTrackingObject : ObservableObject, INotifyPropertyChanged, IDataErrorInfo, INotifyDataErrorInfo, INotifyDataPropertyChanged

Properties

View Source

HasChanges

Gets a value indicating whether this instance was changed.

Declaration
public bool HasChanges { get; }
Property Value
Type Description
bool

Methods

View Source

AcceptChanges()

Sets HasChanges to false.

Declaration
protected virtual void AcceptChanges()
View Source

Cascade()

Aggregates calls to CascadeChanges() and CascadeErrors().

Declaration
protected IDisposable Cascade()
Returns
Type Description
IDisposable

An IDisposable that ends cascading when it's Dispose() method is called.

Exceptions
Type Condition
InvalidOperationException

Thrown when this instance is already cascading.

See Also
CascadeChanges()
CascadeErrors()
View Source

CascadeChanges()

Cascades the HasChanges property from child properties of type ChangeTrackingObject.

Declaration
protected IDisposable CascadeChanges()
Returns
Type Description
IDisposable

An IDisposable that ends cascading when it's Dispose() method is called.

Exceptions
Type Condition
InvalidOperationException

Thrown when this instance is already cascading.

View Source

OnDataPropertyChanged(string)

Called when a data property is changed.

Declaration
protected override void OnDataPropertyChanged(string propertyName)
Parameters
Type Name Description
string propertyName

The name of the property.

Overrides
ObservableObject.OnDataPropertyChanged(string)
See Also
NoDataAttribute
View Source

SetValue<T>(string, ref T, T, Action<T>, Action<T>, IEqualityComparer<T>)

Sets the given value if it is different to the given field using the provided IEqualityComparer<T>. This will trigger a validation raise PropertyChanged if field and value are not equal.

Declaration
protected override void SetValue<T>(string propertyName, ref T field, T value, Action<T> beforeChange, Action<T> afterChange, IEqualityComparer<T> comparer)
Parameters
Type Name Description
string propertyName

The name of the property being changed.

T field

The field which should hold the property value.

T value

The new value.

Action<T> beforeChange

An action executed before the field is set.

Action<T> afterChange

An action executed after the field is set.

IEqualityComparer<T> comparer

The IEqualityComparer<T> used to compare the field and the new value.

Type Parameters
Name Description
T

The type of the property value.

Overrides
ObservableObject.SetValue<T>(string, ref T, T, Action<T>, Action<T>, IEqualityComparer<T>)

Implements

INotifyPropertyChanged
IDataErrorInfo
INotifyDataErrorInfo
INotifyDataPropertyChanged

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
NotifyPropertyChangedExtensions.GetPropertyName<T>(INotifyPropertyChanged, Expression<Func<T>>)
NotifyPropertyChangedExtensions.RaisePropertyChanged(INotifyPropertyChanged, string)
NotifyPropertyChangedExtensions.RaisePropertyChanged<T>(INotifyPropertyChanged, Expression<Func<T>>)
PropertyHelper.RaisePropertyChanged<T>(INotifyPropertyChanged, Expression<Func<T>>, PropertyChangedEventHandler)
  • View Source
Back to top Generated by DocFX