The behavior of the ribbon when we use the Visibility property instead of the IsActive property is very confusing. Please refer to the attached image.
The XAML for the above window is as follows.
<ribbon:RibbonWindow x:Class="ContextualTabsGroupIssues.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
Title="MainWindow"
Width="525"
Height="350">
<ribbon:Ribbon>
<ribbon:Ribbon.Tabs>
<ribbon:Tab Label="Item 1" />
<ribbon:Tab Label="Item 2" />
<ribbon:Tab Label="Item 3" />
</ribbon:Ribbon.Tabs>
<ribbon:Ribbon.ContextualTabGroups>
<ribbon:ContextualTabGroup Visibility="Visible" Label="ContextItems">
<ribbon:Tab Label="Item 1" />
<ribbon:Tab Label="Item 2" />
</ribbon:ContextualTabGroup>
</ribbon:Ribbon.ContextualTabGroups>
</ribbon:Ribbon>
</ribbon:RibbonWindow>
Unfortunately, since setting Visibility directly doesn't crash the app, but insteads degrades quite ungracefully, it is very difficult to debug this issue. We spent a lot of time with debugging why the ribbon was displaying this way.
While I can appreciate that there maybe technical limitations to using Visibility directly, I think it is poor form to not guard against it with at least some kind of exception, and instead to fail without any obvious recourse.
[Modified 12 years ago]