ContextualTabGroup IsActive Property

Ribbon for WPF Forum

Posted 10 years ago by Mark Hanson
Version: 4.5.0484
Avatar
Hi,

Can somebody tell me how ContextualTabGroup IsActive Property and Visibility work together?
Why ContextualTabGroup Visibility doesn't work?
Why Command doesn't execute when ContextualTabGroup IsActive Property is false (i.e. the Command CanExecute handler is not hit anymore)?
How cand I put a binding on IsActive Property. I don't want to set it from codebehind.

Thanks,
Mark

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Mark,

Altering IsActive will alter the Visibility of the contextual tab group. You should always set IsActive and not Visibility directly.

I believe back when it was created we had issues when trying to use Visibility directly and thus added the IsActive. However since it has been a couple years since that code was written, I don't recall what the particular issue was.

If you are having specific problems then we'd need you to put together a simple sample project that shows the issue and email that over to our support address. Thanks.


Actipro Software Support

Posted 7 years ago by Rory Plaire
Avatar

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 7 years ago]

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Rory,

Our documentation on the control says to use IsActive, as does all our samples.  Please don't access the Visibility property directly and instead use IsActive to control the visibility of your contextual tab groups.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.