UIElement.ShouldSerializeCommandBindings 方法


傳回序列化 (Serialization) 處理序是否應該在這個類別的執行個體上,將 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.


true如果 CommandBindings 是在本機設定,則會傳回。This 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. 如果您要開發設計工具或開發自己的控制項,通常會叫用這個方法 UIElementYou 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.