i'm developing a UI with WPF where i want to add buttons for the Undo/Redo inside the application actions. For example, if I input in TextBox1 a value, than another value, by pushing undo it turns back to the first value in textbox1.
I've tried to add a Command="ApplicationCommands.Undo" to the button but it turns grey and it is not clickable anymore on the UI:
<Button x:Name="undoBtn"
BorderBrush="#FFABADB3"
Background="{x:Null}"
Padding="5,0,5,0"
HorizontalAlignment="Left"
Width="100"
Height="25"
VerticalAlignment="Top"
Margin="15,130,0,0"
Click='undoBtn_Click'
Command="ApplicationCommands.Undo"
>
What am i doing wrong?
Thank you very much.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…