Avalon Edit Cut\Copy\Paste Commands from MahApps.Metro Button

423 Views Asked by At

I'm implementing a custom simplified editor in WPF using AvalonEdit and MahApps.Metro. I am stuck trying to get the cut/copy/paste/undo/redo commands working using MahApps.Metro icon/circle buttons instead of a toolbar.

The AvalonEdit sample uses a toolbar, and if I add a similar toolbar to my current application, it works as expected.

I want to call the Cut/Copy/Paste from a series of icon buttons on my app layout instead of inside a toolbar. My MahApps.Metro buttons are as follows. I've tried it with and without the Command Target set. In both cases nothing happens when I click them.

<Button Width="48"
        Height="48"
        Margin="24,0,0,0"
        Style="{DynamicResource MahApps.Metro.Styles.MetroCircleButtonStyle}"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Command="Undo"
        CommandTarget="{Binding ElementName=xmlTextEditor.TextArea}">
        <iconPacks:PackIconMaterial Kind="UndoVariant" />
</Button>

I'm relatively new to WPF so I might be missing something really basic here. Any help is appreciated.

0

There are 0 best solutions below