WPF成员“TabNavigation”无法识别或无法访问。

时间:2015-12-02 18:23:23

标签: c# wpf xaml silverlight

我正在尝试将我的silverlight应用程序转换为wpf应用程序。在自定义控件中,我有这段代码:

<Style TargetType="ComboBox" x:Name="CcsDataGridDynamicCellComboBox" x:Key="CcsDataGridDynamicCellComboBox">
    <Setter Property="Padding" Value="6,2,25,2" />
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="BorderThickness" Value="1"/>
 /////////////this is where i am  facing error: 
    <Setter Property="TabNavigation" Value="Once" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="BorderBrush">
        <Setter.Value>

我遇到的错误是:

  

错误1无法识别或无法访问成员“TabNavigation”。 C:\ Users \ sahluwai \ Desktop \ cusControls2 \ leitch \ HarrisSilverlightToolkit \ Toolkit \ Source \ Controls \ Table \ Themes \ CcsDataGridDynamicCellComboBox.xaml 61 17表

所以这意味着“TabNavigationProperty”在wpf.so中不可用,我应该使用什么,或者是wpf的默认行为,就像我想要指定的那样(即TabNavigationproperty默认为“once”)?< / p>

2 个答案:

答案 0 :(得分:1)

不是正面的,但我认为您正在寻找的属性是KeyboardNavigation.TabNavigation

答案 1 :(得分:0)

对此不确定,但我认为您要做的不是设置TabNavigation属性,而是可以将TabIndex属性设置为您希望组合框在Tab键顺序中的任何值。例如,如果您将TabIndex值设置为4,那么如果您按Tab键4次,则最终会出现在您的comboBox上。这是您可以查看的另一篇文章。 a deque