GridViewDesigner.UsePreviewControl 属性
定义
获取一个值,该值指示设计器是否应使用临时副本取代与设计器关联的实际控件来生成设计时标记。Gets a value indicating whether the designer should use a temporary copy rather than the actual control associated with the designer to generate the design-time markup.
protected:
virtual property bool UsePreviewControl { bool get(); };
protected override bool UsePreviewControl { get; }
member this.UsePreviewControl : bool
Protected Overrides ReadOnly Property UsePreviewControl As Boolean
属性值
如果设计器应使用临时副本(而非与设计器关联的实际控件)来生成设计时标记,则为 true,否则为 false。true if the designer should use a temporary copy rather than the actual control associated with the designer to generate the design-time markup; otherwise, false.
注解
UsePreviewControl属性始终为 true ,设计器使用 View 包含关联控件的副本的控件 GridView 来生成设计时标记。The UsePreviewControl property is always true, the designer uses a View control that contains a copy of the associated GridView control to generate the design-time markup. View控件不影响的任何持久性 GridView 。The View control does not affect any persistence for the GridView.
如果 UsePreviewControl 已重写属性以返回 false ,则设计器将使用关联的 GridView 自身来生成设计时标记,对控件的设计时更改将保留在页标记源中。If the UsePreviewControl property has been overridden to return false, the designer will use the associated GridView itself to generate the design-time markup, and design-time changes to the control will persist to the page markup source.
继承者说明
您可以重写 UsePreviewControl 属性以返回 false 或根据控件是否用类级别对象标记来确定其值 SupportsPreviewControlAttribute 。You can override the UsePreviewControl property to return false or to determine its value based on whether the control is marked with a class-level SupportsPreviewControlAttribute object. 如果 UsePreviewControl 未重写,则将 GridView 忽略 SupportsPreviewControlAttribute 。If the UsePreviewControl is not overridden, the GridView ignores the SupportsPreviewControlAttribute.