功能区自动选择上下文选项卡

发布于 2024-12-28 11:38:13 字数 84 浏览 4 评论 0原文

我的应用程序中有一个带有上下文选项卡的功能区。我已设法根据应用程序中选择的内容正确显示和隐藏选项卡。我的问题是,如何在显示时自动选​​择它(即置于前面)?

I have a ribbon in my application with a contextual tab. I have managed to get the tab to show and hide itself correctly based on what is selected in my application. My question is, how would I get it to be automatically selected (i.e. brought to front) when it is shown?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我也只是我 2025-01-04 11:38:13

我想通了。只需要根据可见性进行样式触发器:

 <r:RibbonTab Header="Options"  
                     ContextualTabGroupHeader="Options" 
                     Visibility="{Binding CurrentFiles.SelectedItem, Converter={StaticResource DSToVisConverter}}" >
            <r:RibbonTab.Style>
                <Style TargetType="r:RibbonTab">
                    <Style.Triggers>
                        <Trigger Property="Visibility" Value="Visible">
                            <Setter Property="IsSelected" Value="True" />
                        </Trigger>
                    </Style.Triggers>                        
                </Style>                   
            </r:RibbonTab.Style>

I figured it out. Just needed to do a style trigger based on the visibility:

 <r:RibbonTab Header="Options"  
                     ContextualTabGroupHeader="Options" 
                     Visibility="{Binding CurrentFiles.SelectedItem, Converter={StaticResource DSToVisConverter}}" >
            <r:RibbonTab.Style>
                <Style TargetType="r:RibbonTab">
                    <Style.Triggers>
                        <Trigger Property="Visibility" Value="Visible">
                            <Setter Property="IsSelected" Value="True" />
                        </Trigger>
                    </Style.Triggers>                        
                </Style>                   
            </r:RibbonTab.Style>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文