AvalonEdit
AvalonEdit copied to clipboard
Undo Command executes when TextEditor is read only.
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>
I second this.
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()).