c# - FluentribbonTabItem 在设计器中不可见?

标签 c# wpf ribbon fluent-ribbon

我正在使用 Fluent-Ribbons 在 wpf 中创建我的 View 。
为了更好地组织我的代码,我想将不同的 RibbonTabItems 放入它们自己的文件中。

问题是:
设计器不显示功能区选项卡的内容。
我只看到一个空白页。

有没有办法让 RibbonTab 在设计器中可见?

最佳答案

如果其他人从 google 登陆这里,我会遇到这种情况,即功能区不仅在设计器中不可见,而且在运行时也不显示。花了一些时间后,我发现您已将通用的流畅功能区主题资源导入到您的窗口或应用程序资源部分,如下所示:

<Window.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Window.Resources>
在此之后,我的功能区开始在设计器和运行时显示。
您也可以以相同的方式使用其他主题。只需像这样覆盖通用主题:
<Window.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/Generic.xaml" />

      <!-- change "Cobalt" to the color you want -->
      <ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/Themes/Dark.Cobalt.xaml" />
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Window.Resources>
希望这可以帮助某人在路上。
归功于 project documentation at github .

关于c# - FluentribbonTabItem 在设计器中不可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38782737/

相关文章:

c# - Azure 存储表插入失败并显示 "One of the request inputs is not valid"

c# - 获取 GridViewColumn 的父级

C# DataGridTextColumn 换行符

c# - VSTO:为什么 OfficeRibbon.Context 为空?

c# - XML 命名空间中不存在标记 'Ribbon'

c# - 更改 ComboBox 文本但不更改所选项目

c# - 使用 Razor 页面调用服务器方法而不重新加载页面

c# - WPF - VirtualizingStackPanel 在 DataGrid 中进入编辑模式时请求所有项目

Excel 隐藏/显示功能区上除自定义选项卡之外的所有选项卡

c# - 在执行每个管道命令后在 C# 中捕获 PowerShell 输出