protected bool Set(
Object? value,
bool invokeChangedEvent = true,
string propertyName = null
)
Protected Function Set (
value As Object,
Optional invokeChangedEvent As Boolean = true,
Optional propertyName As String = Nothing
) As Boolean
protected:
bool Set(
Object^ value,
bool invokeChangedEvent = true,
String^ propertyName = nullptr
)
member Set :
value : Object *
?invokeChangedEvent : bool *
?propertyName : string
(* Defaults:
let _invokeChangedEvent = defaultArg invokeChangedEvent true
let _propertyName = defaultArg propertyName null
*)
-> bool
If a property is redefined in a derived class with a different type, or a type has multiple indexers with different types, then this method may throw an InvalidOperationException. Overriding the CanSetProperty method can solve this issue, but it may lead to further errors if multiple properties use the same key in the inner storage.
ArgumentNullException | propertyName is . |
InvalidOperationException | propertyName 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. |
ObjectDisposedException | IsDisposed returns . |