ContextualGroups Visibility Problem?...

Aug 26, 2013 at 4:02 PM
Hi,

Thanks for creating this excellent component for WPF as an alternate for MS Ribbon. I still like MS Ribbon and wanted to give this a try, but I having problems with the initial Visibility of a RibbonContextualTabGroup.
<!--Contextual Tab Groups-->
<Fluent:Ribbon.ContextualGroups>
    <Fluent:RibbonContextualTabGroup Header="Workspace" Visibility="{Binding Path=PropertiesService.IsHomeToolsVisibility, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}" x:Name="toolsGroup" Background="Green" BorderBrush="Green" />
</Fluent:Ribbon.ContextualGroups>


public class TurahStudyUIViewModel : NotificationObject, ITurahStudyUIViewModel
{
    public TurahStudyUIViewModel(...)
    {
        this.PropertiesService.IsCreateToolsVisibility = Visibility.Collapsed;
        this.PropertiesService.IsReadToolsVisibility = Visibility.Collapsed;
        this.PropertiesService.IsWordToolsVisibility = Visibility.Collapsed;
        this.PropertiesService.IsSpokenToolsVisibility = Visibility.Collapsed;
        this.PropertiesService.IsFontToolsVisibility = Visibility.Collapsed;
        ...
        ..
        .
Its initially Collapsed all and I have several RibbonTabItem groups bind to the RibbonContextualTabGroup.
<!--Contextual Tabs-->
<Fluent:RibbonTabItem Header="Create" Group="{Binding ElementName=toolsGroup}" Visibility="{Binding Path=PropertiesService.IsCreateToolsVisibility, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}">
    <Fluent:RibbonGroupBox Name="CreateContent" Header="Content">
        <Fluent:Button 
            IsEnabled="{Binding Path=PropertiesService.IsEnabledCreateContentCommand, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
            Command="{Binding CreateContentCommand, Mode=OneTime}"/>
        <Fluent:Button 
            IsEnabled="{Binding Path=PropertiesService.IsEnabledDeleteContentCommand, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
            Command="{Binding DeleteContentCommand, Mode=OneTime}"/>
    </Fluent:RibbonGroupBox>

    <Fluent:RibbonGroupBox Name="CreateReference" Header="Reference">
        <Fluent:Button 
            IsEnabled="{Binding Path=PropertiesService.IsEnabledCreateReferenceCommand, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
            Command="{Binding CreateReferenceCommand, Mode=OneTime}"/>
        <Fluent:Button 
            IsEnabled="{Binding Path=PropertiesService.IsEnabledDeleteReferencesCommand, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
            Command="{Binding DeleteReferencesCommand, Mode=OneTime}"/>
    </Fluent:RibbonGroupBox>

</Fluent:RibbonTabItem>
<Fluent:RibbonTabItem Header="Read" Group="{Binding ElementName=toolsGroup}" Visibility="{Binding Path=PropertiesService.IsReadToolsVisibility, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}">

...
..
.
When a workspace is created for example "Create" in code I initial IsCreateToolsVisibility = Visibility.Visible and IsHomeToolsVisibility = Visibility.Visible, but when I do this all the other RibbonTabItem groups appear?
Developer
Oct 11, 2013 at 4:43 PM
Which version are you using?
Could you please provide a full repro for us?
Oct 11, 2013 at 7:22 PM
From my experience you should not use the ContextualTabGroup's visibility. Just change the visibility of the RibbonTabItems (The ContextualTabGroup is automatically hidden when no tabs are visible).