Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
RibbonTabItem Visibility problem using databinding
posted

There appears to be a bug in the ribbon control setting the RibbonTabItem's visibility using databinding.

If you set the first tab's Visibility to "Collapsed" using databinding, the tab is removed from the ribbon but it's contents are displayed instead of the next tab's contents. This only occurs with databinding. If you set the visibility without databinding, everything works properly. This is only a problem with the first tab. All other tabs work fine.

This also occurs if you set the Visibility to Hidden. The tab is hidden but the tab's contents are displayed.

Here is my xaml:

<Window x:Class="RibbonVisibilityTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:igRibbon="http://infragistics.com/Ribbon"
        Title="MainWindow"
        DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <StackPanel>
        <igRibbon:XamRibbon>
            <igRibbon:RibbonTabItem Header="Tab1"
                                    Visibility="{Binding TabVisibility}">
                <igRibbon:RibbonGroup Caption="Group1">
                    <igRibbon:ButtonTool Caption="Button1" />
                </igRibbon:RibbonGroup>
            </igRibbon:RibbonTabItem>
            <igRibbon:RibbonTabItem Header="Tab2">
                <igRibbon:RibbonGroup Caption="Group2">
                    <igRibbon:ButtonTool Caption="Button2" />
                </igRibbon:RibbonGroup>
            </igRibbon:RibbonTabItem>
        </igRibbon:XamRibbon>
    </StackPanel>
</Window>

TabVisibility is a dependency property  in the codebehind.

Parents Reply Children