KGy SOFT

IPersistableObject Interface

KGy SOFT Core Libraries Help
Represents an object that can store its own properties and is able to notify its consumer about property changes.

Namespace:  KGySoft.ComponentModel
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.0.0-rc.1
Syntax

public interface IPersistableObject : INotifyPropertyChanged

The IPersistableObject type exposes the following members.

Methods

  NameDescription
Public methodGetProperties
Gets a copy of the stored properties.
Public methodGetPropertyOrDefaultT
Gets the specified property if it exists in the inner storage and has a compatibly type with T; otherwise, returns defaultValue.
Public methodReplaceProperties
Replaces the properties of the IPersistableObject with the provided new properties. If contains less entries than the actually stored entries, then the difference will be removed from the IPersistableObject.
Public methodResetProperty
Resets the property of the specified propertyName, meaning, it will be removed from the underlying storage so the property getters will return the default value again and TryGetPropertyValue will return .
Public methodSetProperties
Sets the provided properties in the IPersistableObject. The new set of properties will be merged with the existing ones.
Public methodSetProperty
Sets the property to specified value.
Public methodTryGetPropertyValue
Tries to get the specified property from the inner storage.
Public methodTryReplaceProperty
Tries to the replace a property value. The replacement will succeed if the currently stored value equals to originalValue. Non-existing value can be represented by MissingProperty so the method supports also "try remove" and "try add" functionality.
Top
Events

  NameDescription
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from INotifyPropertyChanged.)
Top
Extension Methods

  NameDescription
Public Extension MethodCreatePropertyBinding(String, String, Object)Overloaded.
Creates a special binding for the PropertyChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source.
(Defined by Command.)
Public Extension MethodCreatePropertyBinding(String, String, FuncObject, Object, Object)Overloaded.
Creates a special binding for the PropertyChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source.
(Defined by Command.)
Top
See Also

Reference