# C1.WPF.Input.C1ToggleSwitch

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_Input_C1ToggleSwitch" data-uid="C1.WPF.Input.C1ToggleSwitch" class="text-break">C1ToggleSwitch Class
</h1>
  <div class="markdown level0 summary"><p>Represents a switch that can be toggled between two states.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">C1ToggleSwitch</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.Input.html">C1.WPF.Input</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.Input.dll</h6>
  <h5 id="C1_WPF_Input_C1ToggleSwitch_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[TemplatePart(Name = &quot;ToggleContainer&quot;, Type = typeof(FrameworkElement))]
[TemplateVisualState(Name = &quot;Normal&quot;, GroupName = &quot;CommonStates&quot;)]
[TemplateVisualState(Name = &quot;MouseOver&quot;, GroupName = &quot;CommonStates&quot;)]
[TemplateVisualState(Name = &quot;Focused&quot;, GroupName = &quot;CommonStates&quot;)]
[TemplateVisualState(Name = &quot;Disabled&quot;, GroupName = &quot;CommonStates&quot;)]
[TemplateVisualState(Name = &quot;On&quot;, GroupName = &quot;ToggleStates&quot;)]
[TemplateVisualState(Name = &quot;Off&quot;, GroupName = &quot;ToggleStates&quot;)]
public class C1ToggleSwitch : C1View</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;TemplatePart(Name:=&quot;ToggleContainer&quot;, Type:=GetType(FrameworkElement))&gt;
&lt;TemplateVisualState(Name:=&quot;Normal&quot;, GroupName:=&quot;CommonStates&quot;)&gt;
&lt;TemplateVisualState(Name:=&quot;MouseOver&quot;, GroupName:=&quot;CommonStates&quot;)&gt;
&lt;TemplateVisualState(Name:=&quot;Focused&quot;, GroupName:=&quot;CommonStates&quot;)&gt;
&lt;TemplateVisualState(Name:=&quot;Disabled&quot;, GroupName:=&quot;CommonStates&quot;)&gt;
&lt;TemplateVisualState(Name:=&quot;On&quot;, GroupName:=&quot;ToggleStates&quot;)&gt;
&lt;TemplateVisualState(Name:=&quot;Off&quot;, GroupName:=&quot;ToggleStates&quot;)&gt;
Public Class C1ToggleSwitch
    Inherits C1View</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch__ctor" data-uid="C1.WPF.Input.C1ToggleSwitch.#ctor">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.-ctor.html#C1_WPF_Input_C1ToggleSwitch__ctor">C1ToggleSwitch()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.html">C1ToggleSwitch</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_AccentBrushProperty" data-uid="C1.WPF.Input.C1ToggleSwitch.AccentBrushProperty">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.AccentBrushProperty.html">AccentBrushProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.AccentBrush.html#C1_WPF_Input_C1ToggleSwitch_AccentBrush">AccentBrush</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_AccentForegroundProperty" data-uid="C1.WPF.Input.C1ToggleSwitch.AccentForegroundProperty">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.AccentForegroundProperty.html">AccentForegroundProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.AccentForeground.html#C1_WPF_Input_C1ToggleSwitch_AccentForeground">AccentForeground</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_IsOnProperty" data-uid="C1.WPF.Input.C1ToggleSwitch.IsOnProperty">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.IsOnProperty.html">IsOnProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.IsOn.html#C1_WPF_Input_C1ToggleSwitch_IsOn">IsOn</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_OffContentProperty" data-uid="C1.WPF.Input.C1ToggleSwitch.OffContentProperty">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.OffContentProperty.html">OffContentProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.OffContent.html#C1_WPF_Input_C1ToggleSwitch_OffContent">OffContent</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_OnContentProperty" data-uid="C1.WPF.Input.C1ToggleSwitch.OnContentProperty">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.OnContentProperty.html">OnContentProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.OnContent.html#C1_WPF_Input_C1ToggleSwitch_OnContent">OnContent</a> dependency property.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_AccentBrush" data-uid="C1.WPF.Input.C1ToggleSwitch.AccentBrush">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.AccentBrush.html#C1_WPF_Input_C1ToggleSwitch_AccentBrush">AccentBrush</a>
        </td>
        <td class="markdown level1 summary"><p>Accent brush of the ToggleSwitch control.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_AccentForeground" data-uid="C1.WPF.Input.C1ToggleSwitch.AccentForeground">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.AccentForeground.html#C1_WPF_Input_C1ToggleSwitch_AccentForeground">AccentForeground</a>
        </td>
        <td class="markdown level1 summary"><p>Accent foreground brush of the ToggleSwitch control.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_IsFocused" data-uid="C1.WPF.Input.C1ToggleSwitch.IsFocused">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.IsFocused.html#C1_WPF_Input_C1ToggleSwitch_IsFocused">IsFocused</a>
        </td>
        <td class="markdown level1 summary"><p>Gets whether the control is focused.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_IsOn" data-uid="C1.WPF.Input.C1ToggleSwitch.IsOn">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.IsOn.html#C1_WPF_Input_C1ToggleSwitch_IsOn">IsOn</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value that declares whether the state of the ToggleSwitch is &quot;On&quot;.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_OffContent" data-uid="C1.WPF.Input.C1ToggleSwitch.OffContent">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.OffContent.html#C1_WPF_Input_C1ToggleSwitch_OffContent">OffContent</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the content displayed when the state is Off.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_OnContent" data-uid="C1.WPF.Input.C1ToggleSwitch.OnContent">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.OnContent.html#C1_WPF_Input_C1ToggleSwitch_OnContent">OnContent</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the content displayed when the state is On.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_ChangeVisualStateCommon_System_Boolean_" data-uid="C1.WPF.Input.C1ToggleSwitch.ChangeVisualStateCommon(System.Boolean)">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.ChangeVisualStateCommon.html#C1_WPF_Input_C1ToggleSwitch_ChangeVisualStateCommon_System_Boolean_">ChangeVisualStateCommon(bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Updates the current visual state of the Common visual state group to match the object's properties.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_ChangeVisualStateToggle_System_Boolean_" data-uid="C1.WPF.Input.C1ToggleSwitch.ChangeVisualStateToggle(System.Boolean)">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.ChangeVisualStateToggle.html#C1_WPF_Input_C1ToggleSwitch_ChangeVisualStateToggle_System_Boolean_">ChangeVisualStateToggle(bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Updates the current visual state of the Toggle visual state group to match the object's properties.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_Dispose_System_Boolean_" data-uid="C1.WPF.Input.C1ToggleSwitch.Dispose(System.Boolean)">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.Dispose.html#C1_WPF_Input_C1ToggleSwitch_Dispose_System_Boolean_">Dispose(bool)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_OnApplyTemplate" data-uid="C1.WPF.Input.C1ToggleSwitch.OnApplyTemplate">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.OnApplyTemplate.html#C1_WPF_Input_C1ToggleSwitch_OnApplyTemplate">OnApplyTemplate()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_Toggle" data-uid="C1.WPF.Input.C1ToggleSwitch.Toggle">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.Toggle.html#C1_WPF_Input_C1ToggleSwitch_Toggle">Toggle()</a>
        </td>
        <td class="markdown level1 summary"><p>Inverts the state of the ToggleSwitch control.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_IsOnChanged" data-uid="C1.WPF.Input.C1ToggleSwitch.IsOnChanged">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.IsOnChanged.html">IsOnChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Event raised when the <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.IsOn.html#C1_WPF_Input_C1ToggleSwitch_IsOn">IsOn</a> property has changed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Input_C1ToggleSwitch_Toggled" data-uid="C1.WPF.Input.C1ToggleSwitch.Toggled">
          <a class="xref" href="C1.WPF.Input.C1ToggleSwitch.Toggled.html">Toggled</a>
        </td>
        <td class="markdown level1 summary"><p>Fires when the control's state is changed.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
