#486 – InkCanvas Supports Different Editing Modes

The InkCanvas control has an EditingMode property that allows you to change how you interact with the InkCanvas.  You can draw on it, select strokes that you’ve already drawn, or erase strokes.

EditingMode can take on one of the following values:

  • None – You can’t drawn on the InkCanvas at all
  • Ink – You can draw strokes, using a mouse or stylus

  • GestureOnly – Responds to gestures, does not allow drawing
  • InkAndGesture – Responds to gestures, or allows drawing
  • Select – You can select elements that you previously drew

  • EraseByPoint – You can use the mouse or stylus as an eraser

  • EraseByStroke – You can erase entire strokes by clicking on them

        <ObjectDataProvider x:Key="editingModes" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
                <x:Type TypeName="controls:InkCanvasEditingMode"/>

            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>

        <Border Grid.Column="0" BorderThickness="2" BorderBrush="DodgerBlue"
                Margin="5" >
            <InkCanvas MinHeight="0" MinWidth="0"
                       EditingMode="{Binding ElementName=cboEditingMode, Path=SelectedValue}"/>
        <ComboBox Grid.Column="1" Name="cboEditingMode" Width="100" Height="25" Margin="5"
                  ItemsSource="{Binding Source={StaticResource editingModes}}"/>

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: