简体   繁体   中英

WPF Ribbon Headers not showing

I meet a problem with Fluent Ribbon. I didn't change anything in XAML, but all Headers of my buttons disapeared. 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. 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

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 ". 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).

In my App.xaml file I use the following style :

<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? Well I guess the headers are in textboxes, but they are not empty?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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