ContentElement.IsEnabled 属性

定义

获取或设置一个值,该值指示是否在用户界面 (UI)user interface (UI) 中启用了此元素。Gets or sets a value that indicates whether this element is enabled in the 用户界面 (UI)user interface (UI).

public:
 property bool IsEnabled { bool get(); void set(bool value); };
public bool IsEnabled { get; set; }
member this.IsEnabled : bool with get, set
Public Property IsEnabled As Boolean

属性值

Boolean

如果启用此元素,则为 true;否则为 falsetrue if the element is enabled; otherwise, false. 默认值为 trueThe default value is true.

示例

下面的示例创建一个样式,该样式包含在设置为时提供替换可视行为的属性 setter Hyperlink IsEnabled falseThe following example creates a style that includes a property setter that gives an alternate visual behavior when a Hyperlink is set to IsEnabled false.

<Style.Triggers>
  <Trigger Property="Hyperlink.IsEnabled" Value="false">
    <Setter Property="Foreground" Value="Gray"/>
  </Trigger>
  <Trigger Property="Hyperlink.IsMouseOver" Value="true">
    <Setter Property = "Foreground" Value="{StaticResource BlueGreenBrush}"/>
  </Trigger>
</Style.Triggers>

注解

依赖项属性信息Dependency Property Information

标识符字段Identifier field IsEnabledProperty
元数据属性设置为 trueMetadata properties set to true None

适用于