5
votes

I'm using Ribbon for my WPF app check link >>

I would like hide/collapse area called AuxiliaryPaneContent - check this screenshot:

enter image description here

I read that I need to do that via style but I don't know how.

Here is my code:

<r:Ribbon.ApplicationMenu>                
    <r:RibbonApplicationMenu Visibility="Visible" >
        <r:RibbonApplicationMenu.AuxiliaryPaneContent>
            <!-- STYLE SHOULD BE PROBABLY HERE -->
        </r:RibbonApplicationMenu.AuxiliaryPaneContent>

        <r:RibbonApplicationMenuItem 
                              Header="Item1"                                          
                              Click="ExitClick"
                              IsEnabled="True"
                              KeyTip="O" />
        <r:RibbonApplicationMenuItem 
                              Header="Item2"                                          
                              Click="MyClick"
                              IsEnabled="True"
                              KeyTip="O" />
    </r:RibbonApplicationMenu>                
</r:Ribbon.ApplicationMenu>

Thank you for help.

1
No that's not customizable from outside. You have to override entire Template of RibbonApplicationMenu.Rohit Vats
Do you have tip where can I found soulution for overriding RibbonApplicationMenu. Thank youtonco
You can download source code from here and you can find default template inside. Copy/paste template from there and modify as per your needs.Rohit Vats

1 Answers

7
votes

This worked for me. Just make sure to call it in

RibbonWindow_Loaded(object sender, RoutedEventArgs e)
        {
             var grid = (_ribbonApplicationMenu.Template.FindName("MainPaneBorder",_ribbonApplicationMenu) as Border).Parent as Grid;
             grid.ColumnDefinitions[2].Width = new GridLength(0);
        }