Hi all,
In our app, which uses a RibbonWindow and RibbonView, we have some RibbonTabs that are contextual to the currently open workspace, buttons on these tabs are visible only to the users that have the specific security rights for the command it's bound to. These contextual RibbonTabs and their content are defined in the MainWindow xaml file, each button's visibility is databound via a converter to a CanDoThisOrThat bool property of the current workspace, the button's Command is also bound to an ICommand of the current Workspace. When a workspace is initialized, it reads the security rights of the user and set's the CanDoThisOrThat property which is then used to set the Visibility of the button.
So, our issue now it that depending on the security rights of the user, some RibbonGroups are left empty which looks kind of weird. I have tried some hacky code like hooking-up to the GotFocus event of the RibbonTab and then looping thru its Items to check for IsVisible. if none is found to be visible, the RibbonGroup's visibility is set to Collapsed. This kind of works but some RibbonTab's GotFocus event handler is never called and thus the empty groups are visible.
So my question is: Is there a way to collapse a RibbonGroup when it has no visible children?
Thank you.