小编use*_*389的帖子

WPF - 如何跳过选项卡导航中的标签?

我在用户控件内的网格​​内的堆栈面板内的项目控件内的控件模板内有一个堆栈面板(参见下面的xaml)。在内部堆栈面板中,有一个标签(Name =“NoComponentChosen”)和另一个堆栈面板(Name =“ComponentChosen”)。标签的可见性最初是折叠的。

控件模板有一个带有绑定的数据触发器。当绑定引用具有特定值时,标签 (NoComponentChosen) 变得可见并且堆栈面板折叠。

当我通过用户界面进行切换时,我想跳过标签/堆栈面板。我还希望仍然能够浏览 ChangeRequestView.xaml 中的其余内容(列表框和按钮)。

现在 - 当我选项卡 - 标签/堆栈面板最终被选中并被虚线矩形包围。这就是我想避免的。

这是我的 ChangeRequestView.xaml:

<UserControl x:Class="MyProgram.View.ChangeRequestView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             xmlns:ListBoxBehavior="clr-namespace:MyProgram.Utility"
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="35"/>
            <RowDefinition Height="45*"/>
            <RowDefinition Height="10*"/>
            <RowDefinition Height="20*"/>
            <RowDefinition Height="35"/>
        </Grid.RowDefinitions>

        <!--The title of the view-->
        <Label Grid.Row="0" Content="Change Requests" FontWeight="Bold" Margin="5,5,5,5" VerticalAlignment="Center" HorizontalAlignment="Center"/>

        <!--The component chosen-->
        <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="5,0,0,0" IsHitTestVisible="False" Focusable="False">
            <ItemsControl>
                <ItemsControl.Template>
                    <ControlTemplate>
                        <StackPanel>
                            <StackPanel Name="ComponentChosen" Orientation="Horizontal">
                                <Label Content="Reference des.: " />
                                <Label Name="referenceDesignation" Content="{Binding Path=ReferenceDesignation, …
Run Code Online (Sandbox Code Playgroud)

navigation keyboard wpf xaml tabbing

3
推荐指数
1
解决办法
3502
查看次数

标签 统计

keyboard ×1

navigation ×1

tabbing ×1

wpf ×1

xaml ×1