IPersistableObjectTryReplaceProperty Method
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.
Namespace: KGySoft.ComponentModelAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
bool TryReplaceProperty(
string propertyName,
Object? originalValue,
Object? newValue,
bool triggerChangedEvent = true
)
Function TryReplaceProperty (
propertyName As String,
originalValue As Object,
newValue As Object,
Optional triggerChangedEvent As Boolean = true
) As Boolean
bool TryReplaceProperty(
String^ propertyName,
Object^ originalValue,
Object^ newValue,
bool triggerChangedEvent = true
)
abstract TryReplaceProperty :
propertyName : string *
originalValue : Object *
newValue : Object *
?triggerChangedEvent : bool
(* Defaults:
let _triggerChangedEvent = defaultArg triggerChangedEvent true
*)
-> bool
- propertyName String
- The name of the property.
- originalValue Object
- The original value.
- newValue Object
- The new value.
- triggerChangedEvent Boolean (Optional)
- to allow raising the PropertyChanged event; otherwise, .
Boolean if the originally stored value equals
originalValue and the replacement was successful (even if
originalValue equals
newValue); otherwise,
.