Export (0) Print
Expand All

DeviceType Property (StylusInfo)

Gets a value that indicates if the stylus represents mouse, stylus, or touch input.

XAML
Cannot be used in XAML.
Scripting
value = object.DeviceType
object.DeviceType = value

Property Value

DeviceType

The type of the input device.

This property is read-only.

Remarks

You obtain StylusInfo by calling a method of the MouseEventArgs that you get from mouse event handler input parameters. The stylus input model is tied to mouse events, so that the mouse can be used as a default input mode.

Examples

The following example demonstrates how to display the type of device that was used to create the current StylusPoint.

JavaScript
// Capture mouse movement when the left button is pressed and create the stroke
function InkPresenterMouseDown(sender,args)
{
  // Display the Type of input device in a TextBlock
  device.Text = args.GetStylusInfo().deviceType;
  
  inkPresenter.CaptureMouse();
  newStroke = agCtrl.content.createFromXaml('<Stroke/>');
  
  newStroke.StylusPoints.AddStylusPoints(args.GetStylusPoints(inkPresenter));
  inkPresenter.Strokes.Add(newStroke);
}

Applies To

StylusInfo

See Also

Ink Support In Microsoft Silverlight
DeviceType
MouseEventArgs
GetStylusInfo

Community Additions

Show:
© 2015 Microsoft