XamlObjectWriter.OnSetValue(Object, XamlMember, Object) 方法

定义

为此编写器调用任何与 XamlSetValueHandler 关联的 XamlObjectWriterSettings 引用的方法(只要 handled 事件数据中的 XamlSetValueEventArgs 不为 true)。Invokes any XamlSetValueHandler referenced method that is associated with XamlObjectWriterSettings for this writer, as long as handled in XamlSetValueEventArgs event data is not true.

protected:
 virtual bool OnSetValue(System::Object ^ eventSender, System::Xaml::XamlMember ^ member, System::Object ^ value);
protected virtual bool OnSetValue (object eventSender, System.Xaml.XamlMember member, object value);
abstract member OnSetValue : obj * System.Xaml.XamlMember * obj -> bool
override this.OnSetValue : obj * System.Xaml.XamlMember * obj -> bool
Protected Overridable Function OnSetValue (eventSender As Object, member As XamlMember, value As Object) As Boolean

参数

eventSender
Object

要作为源向处理程序报告的对象。The object to report as the source to the handler.

member
XamlMember

要设置的属性的名称,该名称将作为 XamlSetValueEventArgs 的一部分传递到处理程序。The name of the property to set, which is passed to the handler as part of XamlSetValueEventArgs.

value
Object

要为由 property 命名的属性提供的值。The value to provide for the property that is named by property. 此值作为 XamlSetValueEventArgs 的一部分传递给处理程序。The value is passed to the handler as part of XamlSetValueEventArgs.

返回

Boolean

由任何关联的处理程序设置的布尔值;否则为 falseA Boolean value that is set by any associated handler; otherwise, false.

注解

如果此 XAML 编写器的 SetValue 操作具有关联的处理程序(在 XamlObjectWriterSettings中声明了 XamlSetValueHandler),则此方法将创建新的 XamlSetValueEventArgs 并将其传递给处理程序。If the SetValue operation for this XAML writer has an associated handler (a XamlSetValueHandler is declared in XamlObjectWriterSettings), this method creates new XamlSetValueEventArgs and passes them to the handler. 返回值是通过读取通过事件数据传递的 Handled 值来设置的。The return value is set by reading the Handled value that is passed through the event data. 如果不存在处理程序并且调用了此方法,则调用将返回 falseIf no handler exists and this method is invoked, the call returns false.

适用于