Export (0) Print
Expand All
Key
M11
M12
M21
M22
Tag
Uri
X1
X2
Y1
Y2
Expand Minimize

DeviceType (StylusInfo)

Silverlight

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

value = object.DeviceType
object.DeviceType = value

Type: DeviceType Enumeration

The type of the input device, as a value of the enumeration.

This property is read-only. There is no default.

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

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

// 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);
}

Community Additions

ADD
Show:
© 2015 Microsoft