标签目标扩展器

标签目标扩展器

问题描述:

我有一个标签包含此内容:Fol_Der(带有下划线的Alt用于快捷方式的文件夹)。标签目标扩展器

它所针对的元素是扩展器。

我的目标是当用户按下Alt + D Expander将展开。

但是我得到的,当它被按下一个虚线轮廓:

Dashed expander

我怎样可以针对得当所以它会扩大?

定义一个命令

public static RoutedUICommand ExpandFolderCommand{ get; private set; } 

ExpandFolderCommand= new RoutedUICommand("ExpandFolderCommand", "ExpandFolderCommand", typeof(Commands),  new InputGestureCollection { 
        new KeyGesture(Key.D, ModifierKeys.Alt, "Alt+D") }); 

然后定义你的命令将在窗口/用户控件

<UserControl.CommandBindings> 
      <CommandBinding Command="{x:Static ExpandFolderCommand}" 
          Executed="ExpandFolderCommand_Executed" 
          CanExecute="ExpandFolderCommand_CanExecute"/> 
</UserControl.CommandBindings> 

的ExpandFolderCommand_Executed应扩大您的扩展

进一步阅读Commanding Overview

+0

阿结合,我怀疑目标不会en成为解决方案。谢谢。 – MasterMastic 2013-02-24 14:29:58