Table of Contents

Property UndoOptions

Namespace
Alternet.Editor.Wpf
Assembly
Alternet.Editor.Wpf.v9.dll

UndoOptions

Gets or sets options for undo and redo operations.

public virtual UndoOptions UndoOptions { get; set; }

Property Value

UndoOptions

Examples

Here is how to use a UndoOptions in the C# code:

using System;
using System.Windows;
using Alternet.Editor.Wpf;

public partial class MainWindow : Window
{
    private TextSource textSource;
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var textEdit1 = new TextEditor();
        textSource = new TextSource();
        textSource.LoadFile("myfile.txt");
        textSource.UndoOptions = UndoOptions.GroupUndo | UndoOptions.AllowUndo;

        textEdit1.Source = this.textSource;
    }
}

Here is how to use a UndoOptions in the Visual Basic code:

Imports System
Imports System.Windows
Imports Alternet.Editor.Wpf

Partial Public Class MainWindow
    Inherits Window

    Private textSource As TextSource

    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim textEdit1 = New TextEditor()
        textSource = New TextSource()
        textSource.LoadFile("myfile.txt")
        textSource.UndoOptions = UndoOptions.GroupUndo Or UndoOptions.AllowUndo

        textEdit1.Source = Me.textSource
    End Sub
End Class

Remarks

UndoOptions property determines how exactly undo operations are performed, such as whether similar operations, like text insertion, should be grouped.