Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将导航箭头添加到菜单_C#_Wpf_Xaml_User Interface_Navigation - Fatal编程技术网

C# 将导航箭头添加到菜单

C# 将导航箭头添加到菜单,c#,wpf,xaml,user-interface,navigation,C#,Wpf,Xaml,User Interface,Navigation,我希望在我的系统中实现以下箭头设计,其中箭头位于所选项目上。 目前,我已经将菜单实现为一个列表框,除箭头外,它的行为正常。 实现这种行为的最佳方法是什么 目前,我编辑了ItemsControl并添加了一个箭头,但它位于边框内,而不是边框外,如下所示: <ControlTemplate TargetType="{x:Type ListBoxItem}"> <Grid> <Bord

我希望在我的系统中实现以下箭头设计,其中箭头位于所选项目上。

目前,我已经将菜单实现为一个列表框,除箭头外,它的行为正常。 实现这种行为的最佳方法是什么

目前,我编辑了ItemsControl并添加了一个箭头,但它位于边框内,而不是边框外,如下所示:

<ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Grid>
                        <Border Name="Border">
                            <ContentPresenter Content="{TemplateBinding Content}" />
                        </Border>
                        <Path Name="SelectedArrow" Data="{StaticResource RightArrow}" Width="10" Height="20" Stretch="Fill" Fill="White" HorizontalAlignment="Right" Visibility="Collapsed" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter TargetName="SelectedArrow" Property="Visibility" Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>



覆盖它的ItemTemplate以包含箭头,并在触发器上设置其可见性,该触发器可检查IsSelected的条件。

我不确定如何使箭头位于列表框的“外部”。我在ListBoxItem的ItemControl中实现了以下功能:
我尝试设置边距,但它只是使箭头消失。