ContentControl.ShouldSerializeContent ContentControl.ShouldSerializeContent ContentControl.ShouldSerializeContent ContentControl.ShouldSerializeContent Method

定义

指示是否应使 Content 属性持久化。Indicates whether the Content property should be persisted.

public:
 virtual bool ShouldSerializeContent();
public virtual bool ShouldSerializeContent ();
abstract member ShouldSerializeContent : unit -> bool
override this.ShouldSerializeContent : unit -> bool
Public Overridable Function ShouldSerializeContent () As Boolean

返回

如果应保留 Content 属性,则为 true;否则为 falsetrue if the Content property should be persisted; otherwise, false.

注解

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

适用于