# C1.WPF.Core.AutomationProperties.SetEnabled

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Core_AutomationProperties_SetEnabled_" data-uid="C1.WPF.Core.AutomationProperties.SetEnabled*">SetEnabled Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Core_AutomationProperties_SetEnabled_" data-uid="C1.WPF.Core.AutomationProperties.SetEnabled*"></a>
<h4 id="C1_WPF_Core_AutomationProperties_SetEnabled_System_Windows_DependencyObject_System_Nullable_System_Boolean__" data-uid="C1.WPF.Core.AutomationProperties.SetEnabled(System.Windows.DependencyObject,System.Nullable{System.Boolean})">SetEnabled(DependencyObject, bool?)</h4>
<div class="markdown level1 summary"><p>Sets the value of the <a class="xref" href="C1.WPF.Core.AutomationProperties.EnabledProperty.html">EnabledProperty</a> attached property for a specified dependency object.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void SetEnabled(DependencyObject element, bool? value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Sub SetEnabled(element As DependencyObject, value As Boolean?)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">DependencyObject</span></td>
      <td><span class="parametername">element</span></td>
      <td><p>The element on which to set the property.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">value</span></td>
      <td><p>The new value indicating whether automation is enabled for the element.
When set to <code>null</code>, clears the locally set value of the <a class="xref" href="C1.WPF.Core.AutomationProperties.EnabledProperty.html">EnabledProperty</a>,
causing the element to revert to the inherited or default value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>Thrown if <code class="paramref">element</code> is <code>null</code>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
