AvalonEdit icon indicating copy to clipboard operation
AvalonEdit copied to clipboard

Undo Command executes when TextEditor is read only.

Open accessguru opened this issue 10 years ago • 2 comments

I have a an undo button (along with other buttons) on a tool bar that works with the TextEditor. I've noticed that when the TextEditor.IsReadOnly is set to "true", the the Undo Command will execute on the TextEditor's text. BTW - Very cool control. Great job!!

        <Button Command="Undo">
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                <Image Source="/Resources/undo20.png" Height="20" Width="20" ToolTip="Undo"/>
                <Label Content="Undo"/>
            </StackPanel>
        </Button>

accessguru avatar Oct 19 '15 19:10 accessguru

I second this.

MulleDK19 avatar Feb 23 '16 14:02 MulleDK19

I'm just curious why you don't disable the undo command in this case (for example, bind it to ICommand and check the editor state in CanExecute()).

jimfoye avatar May 14 '17 18:05 jimfoye