Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SelectionChanged Event
Collapse the table of content
Expand the table of content

IncrementalLassoHitTester.SelectionChanged Event

Occurs when the lasso path selects or unselects an ink Stroke.

Namespace:  System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public event LassoSelectionChangedEventHandler SelectionChanged

The following example demonstrates how to dynamically select strokes in a custom control. For the entire sample, see How to: Select Ink from a Custom Control

void selectionTester_SelectionChanged(object sender,
    LassoSelectionChangedEventArgs args)
{
    // Change the color of all selected strokes to red. 
    foreach (Stroke selectedStroke in args.SelectedStrokes)
    {
        selectedStroke.DrawingAttributes.Color = Colors.Red;
        selectedStrokes.Add(selectedStroke);

    }

    // Change the color of all unselected strokes to  
    // their original color. 
    foreach (Stroke unselectedStroke in args.DeselectedStrokes)
    {
        unselectedStroke.DrawingAttributes.Color = inkDA.Color;
        selectedStrokes.Remove(unselectedStroke);
    }
}

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft