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).

 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.

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


相依性屬性資訊Dependency Property Information

識別項欄位Identifier field IsEnabledProperty
若要設定的中繼資料屬性 trueMetadata properties set to true None