PrintDocument for WPF | ComponentOne
C1.WPF.PrintDocument.4.6.2 Assembly / C1.C1Preview Namespace / ActionHandlerBase Class
Members Example

In This Topic
    ActionHandlerBase Class
    In This Topic
    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 RenderInputBase object.
    Object Model
    ActionHandlerBase Class
    Syntax
    'Declaration
     
    Public MustInherit Class ActionHandlerBase 
    public abstract class ActionHandlerBase 
    Remarks

    When a C1PrintDocument containing one or more RenderInputBase-derived objects is shown by a supporting viewer control such as C1PrintPreviewControl, each RenderInputBase object produces a corresponding control on the document page. E.g. a RenderInputText produces a textbox control where the user can enter text, a RenderInputButton produces a pushbutton, and so on.

    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 UserActionEnum enumeration, and includes mouse click, mouse enter and leave, keyboard focus enter and leave, and mouse up and down events.

    To create and attach a handler to a user action on a RenderInputBase-derived object, follow these general steps:

    Note that several InputAction objects can be associated with a single render input control.

    Example
    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:
    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...
    Inheritance Hierarchy
    See Also