다음을 통해 공유


InkCanvas.EditingMode 속성

정의

활성 포인팅 디바이스에 사용되는 사용자 편집 모드를 가져오거나 설정합니다.

public:
 property System::Windows::Controls::InkCanvasEditingMode EditingMode { System::Windows::Controls::InkCanvasEditingMode get(); void set(System::Windows::Controls::InkCanvasEditingMode value); };
public System.Windows.Controls.InkCanvasEditingMode EditingMode { get; set; }
member this.EditingMode : System.Windows.Controls.InkCanvasEditingMode with get, set
Public Property EditingMode As InkCanvasEditingMode

속성 값

InkCanvasEditingMode

태블릿 펜이나 마우스 등의 포인팅 디바이스가 활성 상태일 때 사용되는 편집 모드입니다.

예제

다음 예제에서는 다양 한 유형의에서 편집 모드를 사용 하는 애플리케이션을 만듭니다는 InkCanvas합니다.

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

    InkCanvas inkCanvas1;

    StackPanel stackPanel1;

    DockPanel root;

    public Window1()
    {
        InitializeComponent();
    }

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

        stackPanel1 = new StackPanel();
        root.Children.Add(stackPanel1);

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

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

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

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

        inkCanvas1 = new InkCanvas();
        root.Children.Add(inkCanvas1);
    }

    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;
    }
}
Class Window1
    Inherits Window

    Private inkEditingMode As RadioButton
    Private selectEditingMode As RadioButton
    Private eraseByStrokeEditingMode As RadioButton
    Private eraseByPointEditingMode As RadioButton
    
    Private inkCanvas1 As InkCanvas
    Private stackPanel1 As StackPanel
    Private root As DockPanel
    
    Public Sub New() 
        InitializeComponent()
    
    End Sub
    
    
    Private Sub WindowLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs) 

        root = New DockPanel()
        Me.Content = root

        stackPanel1 = New StackPanel()
        root.Children.Add(stackPanel1)
        
        inkEditingMode = New RadioButton()
        inkEditingMode.Content = "Ink"
        stackPanel1.Children.Add(inkEditingMode)
        AddHandler inkEditingMode.Click, AddressOf inkEditingMode_Click
        inkEditingMode.IsChecked = True
        
        selectEditingMode = New RadioButton()
        selectEditingMode.Content = "Select"
        stackPanel1.Children.Add(selectEditingMode)
        AddHandler selectEditingMode.Click, AddressOf selectEditingMode_Click
        
        eraseByStrokeEditingMode = New RadioButton()
        eraseByStrokeEditingMode.Content = "Erase by Stroke"
        stackPanel1.Children.Add(eraseByStrokeEditingMode)
        AddHandler eraseByStrokeEditingMode.Click, AddressOf eraseByStrokeEditingMode_Click
        
        eraseByPointEditingMode = New RadioButton()
        eraseByPointEditingMode.Content = "Erase by Point"
        stackPanel1.Children.Add(eraseByPointEditingMode)
        AddHandler eraseByPointEditingMode.Click, AddressOf eraseByPointEditingMode_Click
        
        inkCanvas1 = New InkCanvas()
        root.Children.Add(inkCanvas1)
    
    End Sub
    
    
    Private Sub eraseByPointEditingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

        inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByPoint

    End Sub
    
    
    Private Sub eraseByStrokeEditingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

        inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByStroke

    End Sub
    
    
    Private Sub selectEditingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

        inkCanvas1.EditingMode = InkCanvasEditingMode.Select

    End Sub
    
    
    Private Sub inkEditingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

        inkCanvas1.EditingMode = InkCanvasEditingMode.Ink

    End Sub
End Class

설명

기본 EditingModeInk입니다. 변경하면 EditingMode 기존 선택 영역이 지워지게 됩니다.

합니다 EditingMode 와 상호 작용 하는 포인팅 디바이스가 모드를 지정 합니다 InkCanvas합니다. EditingModeInverted 는 스타일러스의 "지우개 끝"이 디지타이저에 연결할 때 일부 디지타이저에서 사용됩니다.

종속성 속성 정보

식별자 필드 EditingModeProperty
메타 데이터 속성 설정 true 없음

적용 대상

추가 정보