Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF: Button mnemonic does not work if placing the button in a toolbar

If I place a Button within a ToolBar in WPF:

<ToolBar FocusManager.IsFocusScope="False"  Grid.Row="1" Name="tools"
         DataContext="{Binding Path=WeekNavigator}">
    <Button Content="_>" Command="{Binding Path=CommandNavigateToNextWeek}"/>
</ToolBar>

The text of the button displays "_>" instead of just ">" and the mnemonic doesn't work. If I move the Button outside of the ToolBar it works as expected.

How can I get the button to behave the same way inside a toolbar (with regards to mnemonics) as outside of one?

like image 803
Marius Avatar asked Feb 02 '10 18:02

Marius


1 Answers

Try this:

<ToolBar>
    <Button>
        <AccessText>_></AccessText>
    </Button>
</ToolBar>
like image 183
John Bowen Avatar answered Nov 15 '22 08:11

John Bowen