5

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.

i3arnon
  • 113,022
  • 33
  • 324
  • 344
tonco
  • 1,281
  • 3
  • 16
  • 30
  • No that's not customizable from outside. You have to override entire Template of `RibbonApplicationMenu`. – Rohit Vats Jan 05 '14 at 14:41
  • Do you have tip where can I found soulution for overriding RibbonApplicationMenu. Thank you – tonco Jan 05 '14 at 15:04
  • You can download source code from [here](http://www.microsoft.com/en-us/download/details.aspx?id=11877) and you can find default template inside. Copy/paste template from there and modify as per your needs. – Rohit Vats Jan 05 '14 at 15:48

1 Answers1

7

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);
        }
user398482
  • 117
  • 2
  • 7