简体   繁体   English

WPF功能区标题未显示

[英]WPF Ribbon Headers not showing

I meet a problem with Fluent Ribbon. 我遇到了Fluent Ribbon的问题。 I didn't change anything in XAML, but all Headers of my buttons disapeared. 我没有在XAML中进行任何更改,但是所有按钮的标题都消失了。 I don't know if it is a bug, or simply a shortcut to change appearance and Hide/Show headers. 我不知道这是一个错误,还是更改外观和“隐藏/显示”标题的快捷方式。

Here is how looks the ribbon : 这是功能区的外观: 标头工作

And how it looks like from now : 以及从现在开始的样子: 标头不起作用

I tried to restart solution but nothing changed, same if I restart VisualStudio. 我尝试重新启动解决方案,但没有任何更改,如果重新启动VisualStudio,则保持不变。 But if I load a backup of solution last week all is working fine, that's why I think there is maybe a shortcut to make them appear/disappear? 但是,如果我上周加载了解决方案的备份,则一切正常,这就是为什么我认为可能存在使它们出现/消失的捷径?

Edit : 编辑:

After additional tests I can add : 经过其他测试后,我可以添加:

  • Issue is present in both Debug and Release mode 在调试和发布模式下均存在问题

  • Problem is on all the solution, in all windows using Ribbon, not only that one 问题在于所有解决方案,在所有使用Ribbon的窗口中,不仅如此

If the code is OK, close the project and clear the cache. 如果代码正确,请关闭项目并清除缓存。 After that do not forget to delete the folders " bin " and " debug " and " release ". 之后,不要忘记删除文件夹“ bin ”,“ debug ”和“ release ”。 Open the project, do a rebuild. 打开项目,进行重建。 Hope to help. 希望对您有所帮助。

I finally decided to restart from a backup, and modify again the code file after file to finally find the issue (apologies to whom I said that I didn't modify xaml, didn't remember about that one, and didn't notice inmediately that this caused a problem). 我最终决定从备份重新启动,然后逐个文件地再次修改代码,以最终找到问题(对不起,我说我没有修改xaml,不记得那个,并且没有立即注意到,对此我深表歉意。造成问题)。

In my App.xaml file I use the following style : 在我的App.xaml文件中,我使用以下样式:

<Style TargetType="ToolTip">
  <Style.Triggers>
     <Trigger Property="Content"
        Value="{x:Static sys:String.Empty}">
       <Setter Property="Visibility"
          Value="Collapsed" />
     </Trigger>
     <Trigger Property="Content"
        Value="{x:Null}">
       <Setter Property="Visibility"
          Value="Collapsed" />
     </Trigger>
  </Style.Triggers>
</Style>
<Style TargetType="TextBlock">
  <Style.Triggers>
     <Trigger Property="Content"
        Value="{x:Static sys:String.Empty}">
       <Setter Property="Visibility"
          Value="Collapsed" />
     </Trigger>
     <Trigger Property="Content"
        Value="{x:Null}">
       <Setter Property="Visibility"
          Value="Collapsed" />
     </Trigger>
  </Style.Triggers>

I had to remove all the block 我不得不删除所有的障碍 and all is working again. 一切都重新开始了。 But then I don't understand why Ribbon headers are influented by the style? 但是然后我不明白为什么Ribbon标题会受到样式的影响? Well I guess the headers are in textboxes, but they are not empty? 好吧,我猜标题在文本框中,但是它们不是空的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM