交互行为和快捷键

时间:2019-01-09 07:14:30

标签: c# wpf

我有按钮,并且已将其附加到Interaction.Behaviors。表示当用户单击按钮时,将执行附签的行为。效果很好。

我的查询现在是该功能的快捷键,该功能在单击按钮时执行。表示当我按ctrl + o时,应该执行该行为。如果sum1可以帮助我,该怎么办。

  1. 我不知道它是否可能。

        <Button Name="OpenFile" Height="110" Width="110" Grid.Column="0" ToolTip="Select G2R file" >
            <StackPanel>
                <Image Source ="/Images/SelectFolder.png"  Height="80" Width="70"/>
                <Label Content="Select G2R file" HorizontalAlignment="Center" FontSize="13" FontFamily="Tahoma" />
            </StackPanel>
            <i:Interaction.Behaviors>
                <Behavior:OpenFileBehavior OpenFilePath="{Binding OpenFilePath}" MessageIdentifier="FileOpen" />
            </i:Interaction.Behaviors>
        </Button>
    

0 个答案:

没有答案
相关问题