Version

AddPropertyChange<TOwner,TProperty>(TOwner,String,TProperty,TProperty,Nullable<Boolean>,String,String) Method

Adds an PropertyChangeUndoUnitBase for the specified property value change to the undo history.
Syntax
'Declaration
 
Public Overloads Function AddPropertyChange
    (Of TOwner As Class,
     TProperty)( _
   ByVal owner As TOwner, _
   ByVal propertyName As String, _
   ByVal oldValue As TProperty, _
   ByVal newValue As TProperty, _
   Optional ByVal preventMerge As Nullable(Of Boolean), _
   Optional ByVal propertyDisplayName As String, _
   Optional ByVal typeDisplayName As String _
) As UndoUnit
public UndoUnit AddPropertyChange<TOwner,TProperty>( 
   TOwner owner,
   string propertyName,
   TProperty oldValue,
   TProperty newValue,
   Nullable<bool> preventMerge,
   string propertyDisplayName,
   string typeDisplayName
)
where TOwner: class

Parameters

owner
The instance whose property was changed
propertyName
The string name of the public property that was changed. This is used to find the PropertyInfo for the property to be affected when the operation is undone.
oldValue
The old value of the property that should be restored when the action is undone.
newValue
The new value of the property
preventMerge
Used to determine if the property change should be prevented from being merged with the top entry on the undo stack when merging is allowed.
propertyDisplayName
The name of the property as it should be displayed to the end user. If this is not specified the actual name of the property will be used.
typeDisplayName
The name of the object whose property is being changed as it should be displayed to the end user.

Type Parameters

TOwner
The type of class whose value was changed
TProperty
The type of the property that was changed

Return Value

Returns the UndoUnit that was added or null if one was not added
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also