KGy SOFT

ObservableObjectBaseSet Method

KGy SOFT Core Libraries Help
Sets the value of a property.
For an example, see the Remarks section of the ObservableObjectBase class.

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

protected bool Set(
	Object value,
	bool invokeChangedEvent = true,
	string propertyName = null
)

Parameters

value
Type: SystemObject
The value to set.
invokeChangedEvent (Optional)
Type: SystemBoolean
If , and the value is different from the previously stored value, then invokes the PropertyChanged event.
propertyName (Optional)
Type: SystemString
Name of the property to set. This parameter is optional.
Default value: The name of the caller member.

Return Value

Type: Boolean
 if property has been set (change occurred); otherwise, .
Exceptions

ExceptionCondition
ArgumentNullExceptionpropertyName is .
InvalidOperationExceptionpropertyName cannot be set.
-or-
CanSetProperty is not overridden and propertyName is not an actual instance property in this instance, or value is not compatible with the property type.
See Also

Reference