Show / Hide Table of Contents

Class ChangeTrackingObject

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

Inheritance
System.Object
ObservableObject
ChangeTrackingObject
ViewModelBase
Implements
System.ComponentModel.INotifyPropertyChanged
System.ComponentModel.IDataErrorInfo
System.ComponentModel.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, T, T)
ObservableObject.SetValue<T>(String, T, T, IEqualityComparer<T>)
ObservableObject.SetValue<T>(String, T, T, Action<T>, Action<T>)
ObservableObject.INotifyDataPropertyChanged.DataPropertyChanged
ObservableObject.INotifyDataErrorInfo.ErrorsChanged
ObservableObject.IDataErrorInfo.Error
ObservableObject.INotifyDataErrorInfo.HasErrors
ObservableObject.INotifyDataErrorInfo.GetErrors(String)
ObservableObject.IDataErrorInfo.Item[String]
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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
System.Boolean

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
System.IDisposable

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

Exceptions
Type Condition
System.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
System.IDisposable

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

Exceptions
Type Condition
System.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
System.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 System.Collections.Generic.IEqualityComparer<T>. This will trigger a validation raise System.ComponentModel.INotifyPropertyChanged.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
System.String propertyName

The name of the property being changed.

T field

The field which should hold the property value.

T value

The new value.

System.Action<T> beforeChange

An action executed before the field is set.

System.Action<T> afterChange

An action executed after the field is set.

System.Collections.Generic.IEqualityComparer<T> comparer

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

Type Parameters
Name Description
T

The type of the property value.

Overrides
Sartorius.SAF.Infrastructure.ObservableObject.SetValue<T>(System.String, T, T, System.Action<T>, System.Action<T>, System.Collections.Generic.IEqualityComparer<T>)

Implements

System.ComponentModel.INotifyPropertyChanged
System.ComponentModel.IDataErrorInfo
System.ComponentModel.INotifyDataErrorInfo
INotifyDataPropertyChanged

Extension Methods

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