3

I would like to create a StaticResource KeyBinding, but I cannot figure out how I would de-reference it. So, in my Window.Resources, I might put the following:

<Window.Resources>
        <ResourceDictionary>

            <KeyBinding
                x:Key="CtrlRightKeyBinding"
                Modifiers="Control"
                Key="Right"
                Command="{Binding MyCommand}"
                CommandParameter="{Binding DirectionInfoRight}" />

        </ResourceDictionary>
</Window.Resources>

However, I do not know how to de-reference it when setting my InputBindings:

<Window.InputBindings>
???
</Window.InputBindings>

Any thoughts or suggestions?

4

1 回答 1

1

尝试这个:

<Window.InputBindings>
    <StaticResource ResourceKey="CtrlRightKeyBinding" />
</Window.InputBindings>

请参阅静态资源标记扩展

于 2012-04-24T19:46:13.450 回答