Export (0) Print
Expand All

DynamicRenderer.Reset Method

Clears rendering on the current stroke and redraws it.

Namespace:  System.Windows.Input.StylusPlugIns
Assembly:  PresentationCore (in PresentationCore.dll)

public virtual void Reset(
	StylusDevice stylusDevice,
	StylusPointCollection stylusPoints
)

Parameters

stylusDevice
Type: System.Windows.Input.StylusDevice

The current stylus device.

stylusPoints
Type: System.Windows.Input.StylusPointCollection

The stylus points to be redrawn.

ExceptionCondition
ArgumentException

Neither the stylus nor the mouse is in the down state.

The DynamicRenderer redraws the current stroke and any of the stylus points passed into the Reset method. This method allows you to redraw a stroke while the user is still creating the stroke. The tablet pen must be touching the digitizer or the left mouse button must be pressed when Reset is called.

Notes to Inheritors

When overriding Reset in a derived class, be sure to call the base class’s Reset method.

The following example changes the color of the current stroke as it is being drawn.

bool selectionMode = false;

public void ToggleSelect()
{
    StylusDevice currentStylus = Stylus.CurrentStylusDevice;

    // Check if the stylus is down or the mouse is pressed. 
    if (Mouse.LeftButton != MouseButtonState.Pressed &&
        (currentStylus == null || currentStylus.InAir))
    {
        return;
    }

    selectionMode = !selectionMode;

    // If the control is in selection mode, change the color of  
    // the current stroke dark gray. 
    if (selectionMode)
    {
        dynamicRenderer1.DrawingAttributes.Color = Colors.DarkGray;

    }
    else
    {
        dynamicRenderer1.DrawingAttributes.Color = Colors.Purple;

    }

    dynamicRenderer1.Reset(currentStylus, stylusPoints);
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft