# C1.C1Preview.ActionHandlerBase

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_C1Preview_ActionHandlerBase" data-uid="C1.C1Preview.ActionHandlerBase" class="text-break">ActionHandlerBase Class
</h1>
  <div class="markdown level0 summary"><p>The abstract base class for types representing various document-related actions
that can be performed in response to a user action on a control
produced by a <a class="xref" href="C1.C1Preview.RenderInputBase.html">RenderInputBase</a> object.</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">ActionHandlerBase</span></div>
      <div class="level2"><a class="xref" href="C1.C1Preview.ActionHandlerFile.html">ActionHandlerFile</a></div>
      <div class="level2"><a class="xref" href="C1.C1Preview.ActionHandlerHistoryNext.html">ActionHandlerHistoryNext</a></div>
      <div class="level2"><a class="xref" href="C1.C1Preview.ActionHandlerHistoryPrev.html">ActionHandlerHistoryPrev</a></div>
      <div class="level2"><a class="xref" href="C1.C1Preview.ActionHandlerLink.html">ActionHandlerLink</a></div>
      <div class="level2"><a class="xref" href="C1.C1Preview.ActionHandlerPageSetup.html">ActionHandlerPageSetup</a></div>
      <div class="level2"><a class="xref" href="C1.C1Preview.ActionHandlerPageView.html">ActionHandlerPageView</a></div>
      <div class="level2"><a class="xref" href="C1.C1Preview.ActionHandlerPrint.html">ActionHandlerPrint</a></div>
      <div class="level2"><a class="xref" href="C1.C1Preview.ActionHandlerReflow.html">ActionHandlerReflow</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.C1Preview.html">C1.C1Preview</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.PrintDocument.4.6.2.dll</h6>
  <h5 id="C1_C1Preview_ActionHandlerBase_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[C1ClassSerialization(true)]
public abstract class ActionHandlerBase</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;C1ClassSerialization(True)&gt;
Public MustInherit Class ActionHandlerBase</code></pre>
  </div>
  <h5 id="C1_C1Preview_ActionHandlerBase_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;p&gt;
</code></pre>
<p>When a <a class="xref" href="C1.C1Preview.C1PrintDocument.html">C1PrintDocument</a> containing one or more <a class="xref" href="C1.C1Preview.RenderInputBase.html">RenderInputBase</a>-derived objects
is shown by a supporting viewer control such as <b>C1PrintPreviewControl</b>,
each <b>RenderInputBase</b> object produces a corresponding control on the document page.
E.g. a <a class="xref" href="C1.C1Preview.RenderInputText.html">RenderInputText</a> produces a <b>textbox</b> control where the user can
enter text, a <a class="xref" href="C1.C1Preview.RenderInputButton.html">RenderInputButton</a> produces a <b>pushbutton</b>, and so on.</p>

    <p>
The functionality of those input controls in the document can be expanded via "action handlers",
which are similar to C# or VB event handlers that can be assigned to events on many .NET components.
The list of supported events is specified by the <a class="xref" href="C1.C1Preview.UserActionEnum.html">UserActionEnum</a> enumeration,
and includes mouse click, mouse enter and leave, keyboard focus enter and leave,
and mouse up and down events.
</p>
    <p>
To create and attach a handler to a user action on a <a class="xref" href="C1.C1Preview.RenderInputBase.html">RenderInputBase</a>-derived object,
follow these general steps:
</p>
    <ul><li>
Create an instance of a <a class="xref" href="C1.C1Preview.ActionHandlerBase.html">ActionHandlerBase</a>-derived class of the concrete type
that matches the action that needs to be performed, such as a hyperlink jump or a file operation.
(Those classes include
<a class="xref" href="C1.C1Preview.ActionHandlerLink.html">ActionHandlerLink</a>,
<a class="xref" href="C1.C1Preview.ActionHandlerFileOpen.html">ActionHandlerFileOpen</a>,
<a class="xref" href="C1.C1Preview.ActionHandlerFileSave.html">ActionHandlerFileSave</a>,
<a class="xref" href="C1.C1Preview.ActionHandlerPageSetup.html">ActionHandlerPageSetup</a>,
<a class="xref" href="C1.C1Preview.ActionHandlerPrint.html">ActionHandlerPrint</a>,
<a class="xref" href="C1.C1Preview.ActionHandlerReflow.html">ActionHandlerReflow</a>,
<a class="xref" href="C1.C1Preview.ActionHandlerPageView.html">ActionHandlerPageView</a>,
<a class="xref" href="C1.C1Preview.ActionHandlerHistoryPrev.html">ActionHandlerHistoryPrev</a> and
<a class="xref" href="C1.C1Preview.ActionHandlerHistoryNext.html">ActionHandlerHistoryNext</a>.)
</li><li>
Some of those classes expose action-specific properties
(such as <a class="xref" href="C1.C1Preview.ActionHandlerFile.FileName.html#C1_C1Preview_ActionHandlerFile_FileName">FileName</a>).
Adjust the values of those properties as needed.
</li><li>
Create an instance of the <a class="xref" href="C1.C1Preview.InputAction.html">InputAction</a> class, set its <a class="xref" href="C1.C1Preview.InputAction.UserAction.html#C1_C1Preview_InputAction_UserAction">UserAction</a>
property to the desired user action (such as click or focus enter),
and set its <a class="xref" href="C1.C1Preview.InputAction.ActionHandler.html#C1_C1Preview_InputAction_ActionHandler">ActionHandler</a> property to the
<a class="xref" href="C1.C1Preview.ActionHandlerBase.html">ActionHandlerBase</a> instance created in the preceding steps.
</li><li>
Add the <a class="xref" href="C1.C1Preview.InputAction.html">InputAction</a> to the <a class="xref" href="C1.C1Preview.RenderInputBase.InputActions.html#C1_C1Preview_RenderInputBase_InputActions">InputActions</a>
collection of the <a class="xref" href="C1.C1Preview.RenderInputBase.html">RenderInputBase</a> object.
</li></ul>
    <p>Note that several <a class="xref" href="C1.C1Preview.InputAction.html">InputAction</a> objects can be associated
with a single render input control.</p>
</div>
  <h5 id="C1_C1Preview_ActionHandlerBase_examples"><strong>Examples</strong></h5>
  <p>The following example shows how to add a button that would jump to the last page
of the current document when clicked, to a document:</p>
<pre><code class="lang-csharp">C1PrintDocument doc = new C1PrintDocument();
// Create an action handler that would jump to the last page:
ActionHandlerLink ahl = new ActionHandlerLink(new C1LinkTargetPage(PageJumpTypeEnum.Last));
// Create an input action, set its properties:
InputAction ia = new InputAction();
ia.ActionHandler = ahl;
ia.UserAction = UserActionEnum.Click;
// Create a button, add the input action to its actions:
RenderInputButton rbtn = new RenderInputButton("Jump to last page");
rbtn.InputActions.Add(ia);
// Add the button to the document:
doc.Body.Children.Add(rbtn);
// ...add more content to the document...</code></pre>

  <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_C1Preview_ActionHandlerBase__ctor" data-uid="C1.C1Preview.ActionHandlerBase.#ctor">
          <a class="xref" href="C1.C1Preview.ActionHandlerBase.-ctor.html#C1_C1Preview_ActionHandlerBase__ctor">ActionHandlerBase()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>

</div>
