ToolboxItem.ValidatePropertyValue(String, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在屬性被指派到屬性字典之前,先驗證該屬性。
protected:
virtual System::Object ^ ValidatePropertyValue(System::String ^ propertyName, System::Object ^ value);
protected virtual object ValidatePropertyValue(string propertyName, object value);
protected virtual object? ValidatePropertyValue(string propertyName, object? value);
abstract member ValidatePropertyValue : string * obj -> obj
override this.ValidatePropertyValue : string * obj -> obj
Protected Overridable Function ValidatePropertyValue (propertyName As String, value As Object) As Object
參數
- propertyName
- String
用來驗證房產名稱。
- value
- Object
要驗證的價值。
傳回
用於驗證的值。
例外狀況
value 是 null,且 propertyName 是「瞬移」。
備註
ValidatePropertyValue每當屬性字典中設定值時,該方法就會被呼叫。 透過此方法,你可以在提交物件前更改其值,或透過拋出例外來拒絕它。