StylusPlugInCollection Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represent a collection of StylusPlugIn objects.
public ref class StylusPlugInCollection sealed : System::Collections::ObjectModel::Collection<System::Windows::Input::StylusPlugIns::StylusPlugIn ^>
public sealed class StylusPlugInCollection : System.Collections.ObjectModel.Collection<System.Windows.Input.StylusPlugIns.StylusPlugIn>
type StylusPlugInCollection = class
inherit Collection<StylusPlugIn>
Public NotInheritable Class StylusPlugInCollection
Inherits Collection(Of StylusPlugIn)
- Inheritance
Examples
The following example demonstrates how to add a DynamicRenderer to a custom control. To create a control that collects ink, see Creating an Ink Input Control.
// Create a DrawingAttributes to use for the
// DynamicRenderer.
DrawingAttributes inkDA = new DrawingAttributes();
inkDA.Width = 5;
inkDA.Height = 5;
inkDA.Color = Colors.Purple;
// Add a dynamic renderer plugin that
// draws ink as it "flows" from the stylus
DynamicRenderer dynamicRenderer1 = new DynamicRenderer();
dynamicRenderer1.DrawingAttributes = inkDA;
this.StylusPlugIns.Add(dynamicRenderer1);
inkPresenter1.AttachVisuals(dynamicRenderer1.RootVisual,
dynamicRenderer1.DrawingAttributes);
' Create a DrawingAttributes to use for the
' DynamicRenderer.
Dim inkDA As New DrawingAttributes()
inkDA.Width = 5
inkDA.Height = 5
inkDA.Color = Colors.Purple
' Add a dynamic renderer plugin that
' draws ink as it "flows" from the stylus
Dim dynamicRenderer1 As New DynamicRenderer()
dynamicRenderer1.DrawingAttributes = inkDA
Me.StylusPlugIns.Add(dynamicRenderer1)
inkPresenter1.AttachVisuals(dynamicRenderer1.RootVisual, dynamicRenderer1.DrawingAttributes)
Remarks
Each UIElement has a StylusPlugIns property that is a StylusPlugInCollection. Add a StylusPlugIn to the element's StylusPlugIns property to manipulate ink on the real-time thread. The order of the StylusPlugIn objects in the StylusPlugInCollection affects the appearance of the ink when it is rendered. Suppose you have a DynamicRenderer called dynamicRenderer and a custom StylusPlugIn called translatePlugin that offsets the ink from the tablet pen. If translatePlugin is the first StylusPlugIn in the StylusPlugInCollection, and dynamicRenderer is the second, the ink that "flows" will be offset as the user moves the pen. If dynamicRenderer is first, and translatePlugin is second, the ink will seem to "flow" underneath the pen, and when the user lifts the pen, the ink will move.