ContentElement.IsEnabled ContentElement.IsEnabled ContentElement.IsEnabled ContentElement.IsEnabled Property

定義

取得或設定值,這個值表示這個項目是否已在 使用者介面 (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

屬性值

如果已啟用該項目則為 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

適用於