InkCanvas.SelectionChanging Olay

Tanım

Yeni bir mürekkep vuruşları ve/veya öğeleri kümesi seçildiğinde gerçekleşir.

public:
 event System::Windows::Controls::InkCanvasSelectionChangingEventHandler ^ SelectionChanging;
public event System.Windows.Controls.InkCanvasSelectionChangingEventHandler SelectionChanging;
member this.SelectionChanging : System.Windows.Controls.InkCanvasSelectionChangingEventHandler 
Public Custom Event SelectionChanging As InkCanvasSelectionChangingEventHandler 
Public Event SelectionChanging As InkCanvasSelectionChangingEventHandler 

Olay Türü

Örnekler

Aşağıdaki örnek seçili vuruşları kraliyet mavisi yapar.

void inkCanvas1_SelectionChanging(object sender, InkCanvasSelectionChangingEventArgs e)
{
    StrokeCollection selectedStrokes = e.GetSelectedStrokes();
    
    foreach (Stroke aStroke in inkCanvas1.Strokes)
    {
        if (selectedStrokes.Contains(aStroke))
        {
            aStroke.DrawingAttributes.Color = Colors.RoyalBlue;
        }
        else
        {
            aStroke.DrawingAttributes.Color = inkCanvas1.DefaultDrawingAttributes.Color;
        }
    }
}
Private Sub inkCanvas1_SelectionChanging(ByVal sender As Object, _
                                 ByVal e As InkCanvasSelectionChangingEventArgs)

    Dim selectedStrokes As StrokeCollection = e.GetSelectedStrokes()

    Dim aStroke As Stroke
    For Each aStroke In inkCanvas1.Strokes
        If selectedStrokes.Contains(aStroke) Then
            aStroke.DrawingAttributes.Color = Colors.RoyalBlue
        Else
            aStroke.DrawingAttributes.Color = inkCanvas1.DefaultDrawingAttributes.Color
        End If
    Next aStroke

End Sub

Açıklamalar

Kullanıcı SelectionChanging tarafından vuruşlar ve/veya öğeler seçildiğinde ancak değişiklik uygulanmadan önce olay tetiklenir.

bir SelectionChanging nesnesi aldığında InkCanvasSelectionChangingEventHandlerInkCanvasSelectionChangingEventArgs olay işlenir. InkCanvasSelectionChangingEventArgskullanıcı tarafından seçildikten sonra ve StrokeCollection nesnelerine erişmek FrameworkElement için yöntemler sağlar.

Değişiklik uygulandıktan SelectionChanged sonra olay oluşturulur.

Not

Seçilen SelectionChanging vuruşlar silindiğinde veya özellik değiştiğinde ActiveEditingMode olay gerçekleşmez.

Şunlara uygulanır

Ayrıca bkz.