UIElement.ShouldSerializeCommandBindings Method


返回序列化进程是否应在此类的实例上序列化 CommandBindings 属性的内容。Returns whether serialization processes should serialize the contents of the CommandBindings property on instances of this class.

 bool ShouldSerializeCommandBindings();
public bool ShouldSerializeCommandBindings ();
member this.ShouldSerializeCommandBindings : unit -> bool
Public Function ShouldSerializeCommandBindings () As Boolean



如果应当序列化 CommandBindings 属性值,则为 true;否则为 falsetrue if the CommandBindings property value should be serialized; otherwise, false.


如果本地设置 CommandBindings,这将返回 trueThis will return true if CommandBindings is locally set.

提供此 ShouldSerialize 方法的原因是 CommandBindings 属性没有简单的默认值。This ShouldSerialize method is provided because the CommandBindings property does not have a simple default value. 此方法指示属性是否已更改为其默认值。This method indicates whether the property has changed from its default value. 如果要开发设计器或开发自己的包含 UIElement的控件,通常会调用此方法。You typically invoke this method if you are either developing a designer or developing your own control incorporating a UIElement.

有关详细信息,请参阅用 ShouldSerialize 和 Reset 方法定义默认值For more information, see Defining Default Values with the ShouldSerialize and Reset Methods.

Applies to