# C1.WPF.C1DragHelper.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_C1DragHelper__ctor_" data-uid="C1.WPF.C1DragHelper.#ctor*">C1DragHelper Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_C1DragHelper__ctor_" data-uid="C1.WPF.C1DragHelper.#ctor*"></a>
<h4 id="C1_WPF_C1DragHelper__ctor_System_Windows_UIElement_C1_WPF_C1DragHelperMode_System_Double_System_Boolean_System_Boolean_System_Boolean_System_Boolean_" data-uid="C1.WPF.C1DragHelper.#ctor(System.Windows.UIElement,C1.WPF.C1DragHelperMode,System.Double,System.Boolean,System.Boolean,System.Boolean,System.Boolean)">C1DragHelper(UIElement, C1DragHelperMode, double, bool, bool, bool, bool)</h4>
<div class="markdown level1 summary"><p>Initializes a new <a class="xref" href="C1.WPF.C1DragHelper.html">C1DragHelper</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1DragHelper(UIElement element, C1DragHelperMode mode = C1DragHelperMode.TranslateXY, double initialThreshold = 1, bool captureElementOnPointerPressed = true, bool handledEventsToo = false, bool useManipulationEvents = false, bool useRightButton = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(element As UIElement, Optional mode As C1DragHelperMode = C1DragHelperMode.TranslateXY, Optional initialThreshold As Double = 1, Optional captureElementOnPointerPressed As Boolean = True, Optional handledEventsToo As Boolean = False, Optional useManipulationEvents As Boolean = False, Optional useRightButton As Boolean = False)</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.uielement">UIElement</a></td>
      <td><span class="parametername">element</span></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.uielement">UIElement</a> on which the drag gesture will be listened.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.C1DragHelperMode.html">C1DragHelperMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td><p>Indicates the sort of drag to be listened. Combine inertia flag with other flags so that DragDelta events are raised after the manipulation finish. i.e. C1DragHelperMode.FreeDrag | C1DragHelperMode.Inertia</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">initialThreshold</span></td>
      <td><p>Specifies the number of pixels the gesture will have to pass in order to start. if 0 is set the gesture will start on pointer down, and captureElementOnPointerPressed will be true despite the specified parameter, otherwise the gesture will start on mouse move, default value is 1</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">captureElementOnPointerPressed</span></td>
      <td><p>Indicates whether the element will be captured in pointer pressed event (MouseLeftButtonDown in SL and WPF and PointerPressed in WinRT) or in the first pointer move event (MouseMove in SL and WPF and PointerMoved in WinRT). If initialThreshold is 0 this parameter will be ignored.<remarks>Capturing the element on mouse down will cause Click, DoubleClick and MouseLeftButtonUp events not to be fired in sub-elements (nested elements in the visual tree), whereas capturing the element on the first mouse move can make it difficult for final users to drag small elements quickly.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">handledEventsToo</span></td>
      <td><p>Indicates whether drag gestures will be listened despite mouse events were already handled. (It only applies to mouse gestures)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">useManipulationEvents</span></td>
      <td><p>When set to true it uses Manipulation events to listen to the gesture, otherwise itwill use Pointer events.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">useRightButton</span></td>
      <td><p>if set to <code>true</code> it will listen to mouse right button down/up events instead of left button events(In WinRT it only applies if useManipulationEvents is set to false).</p>
</td>
    </tr>
  </tbody>
</table>
</div>
