EditingMode Property

InkCanvas.EditingMode Property


Gets or sets the user editing mode used by an active pointing device.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public InkCanvasEditingMode EditingMode { get; set; }

Property Value

Type: System.Windows.Controls.InkCanvasEditingMode

The editing mode used when a pointing device (such as a tablet pen or mouse) is active.

The default EditingMode is Ink. Changing the EditingMode clears any existing selections.

The EditingMode specifies the mode of the pointing device as it interacts with the InkCanvas. EditingModeInverted is used by some digitizers when the "eraser end" of the stylus contacts the digitizer.

Identifier field


Metadata properties set to true


The following example creates an application that uses the various types of editing modes on an InkCanvas.

public partial class Window1 : Window
    RadioButton inkEditingMode;
    RadioButton selectEditingMode;
    RadioButton eraseByStrokeEditingMode;
    RadioButton eraseByPointEditingMode;

    InkCanvas inkCanvas1;

    StackPanel stackPanel1;

    DockPanel root;

    public Window1()

    private void WindowLoaded(object sender, RoutedEventArgs e)
        root = new DockPanel();
        this.Content = root;

        stackPanel1 = new StackPanel();

        inkEditingMode = new RadioButton();
        inkEditingMode.Content = "Ink";
        inkEditingMode.Click += new RoutedEventHandler(inkEditingMode_Click);
        inkEditingMode.IsChecked = true;

        selectEditingMode = new RadioButton();
        selectEditingMode.Content = "Select";
        selectEditingMode.Click += new RoutedEventHandler(selectEditingMode_Click);

        eraseByStrokeEditingMode = new RadioButton();
        eraseByStrokeEditingMode.Content = "Erase by Stroke";
        eraseByStrokeEditingMode.Click += new RoutedEventHandler(eraseByStrokeEditingMode_Click);

        eraseByPointEditingMode = new RadioButton();
        eraseByPointEditingMode.Content = "Erase by Point";
        eraseByPointEditingMode.Click += new RoutedEventHandler(eraseByPointEditingMode_Click);

        inkCanvas1 = new InkCanvas();

    void eraseByPointEditingMode_Click(object sender, RoutedEventArgs e)
        inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByPoint;

    void eraseByStrokeEditingMode_Click(object sender, RoutedEventArgs e)
        inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByStroke;

    void selectEditingMode_Click(object sender, RoutedEventArgs e)
        inkCanvas1.EditingMode = InkCanvasEditingMode.Select;

    void inkEditingMode_Click(object sender, RoutedEventArgs e)
        inkCanvas1.EditingMode = InkCanvasEditingMode.Ink;

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft