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
Available since 3.0
Return to top
Show: