This topic has not yet been rated - Rate this topic

ContentElement.IsEnabled Property

Gets or sets a value that indicates whether this element is enabled in the user interface (UI). This is a dependency property.

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
public bool IsEnabled { get; set; }
<object IsEnabled="bool" .../>

Property Value

Type: System.Boolean
true if the element is enabled; otherwise, false. The default value is true.

Implements

IInputElement.IsEnabled

Identifier field

IsEnabledProperty

Metadata properties set to true

None

The 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>

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.