代码之家  ›  专栏  ›  技术社区  ›  Dean Kuga

Caliburn微型键盘快捷键不工作

  •  0
  • Dean Kuga  · 技术社区  · 7 年前

    给定以下XAML:

    <UserControl x:Class="Solution.Views.SomeView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:cm="http://www.caliburnproject.org"
        cm:Message.Attach="[Key F11] = [ToggleFullScreen]">
        <Grid>
            <ToolBar DockPanel.Dock="Top" Margin="0">
                <xctk:IconButton Style="{StaticResource ToolBarButton}" ToolTip="Full Screen (F11)"
                    cm:Message.Attach="ToggleFullScreen">
                    <Image Style="{StaticResource ToolBarButtonImage}" Source="pack://application:,,,/Resources/Img/Full_Screen32.png"/>
                </xctk:IconButton>
            </ToolBar>
        </Grid>
    </UserControl>
    

    ToggleFullScreen 方法,但按钮点击将。将[键F11]更改为[手势Alt+F]或[手势F11]也不起作用。。。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Dean Kuga    7 年前

    看看这位官员 Scenario.KeyBinding GitHub上的示例。特别注意 Configure() 中的方法 Bootstrapper ToggleFullScreen() 方法 ShellViewModel 在示例项目中初始化并设置 cal:Message.Attach 房屋附属物 ShellView [Key F11] = [ToggleFullScreen] 就像您在示例中所做的那样,它应该是有效的。

    配置() 方法,并将 Input 将示例项目的文件夹添加到项目中。