IncrementalLassoHitTester.SelectionChanged IncrementalLassoHitTester.SelectionChanged IncrementalLassoHitTester.SelectionChanged IncrementalLassoHitTester.SelectionChanged Event

Definizione

Si verifica quando il tracciato del lazo seleziona o deseleziona un oggetto Stroke di un input penna.Occurs when the lasso path selects or unselects an ink Stroke.

public:
 event System::Windows::Ink::LassoSelectionChangedEventHandler ^ SelectionChanged;
public event System.Windows.Ink.LassoSelectionChangedEventHandler SelectionChanged;
member this.SelectionChanged : System.Windows.Ink.LassoSelectionChangedEventHandler 
Public Event SelectionChanged As LassoSelectionChangedEventHandler 

Esempi

Nell'esempio seguente viene illustrato come selezionare dinamicamente i tratti in un controllo personalizzato.The following example demonstrates how to dynamically select strokes in a custom control. Per l'intero esempio, vedere procedura: Selezionare l'input penna da un controllo personalizzatoFor 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);
    }
}
Private Sub selectionTester_SelectionChanged(ByVal sender As Object, _
    ByVal args As LassoSelectionChangedEventArgs)

    ' Change the color of all selected strokes to red.
    For Each selectedStroke As Stroke In args.SelectedStrokes
        selectedStroke.DrawingAttributes.Color = Colors.Red
        selectedStrokes.Add(selectedStroke)
    Next selectedStroke

    ' Change the color of all unselected strokes to 
    ' their original color.
    For Each unselectedStroke As Stroke In args.DeselectedStrokes
        unselectedStroke.DrawingAttributes.Color = inkDA.Color
        selectedStrokes.Remove(unselectedStroke)
    Next unselectedStroke

End Sub

Si applica a