Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Ribbon AuxiliaryPaneContent hide or collapse

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.

like image 558
tonco Avatar asked Jan 05 '14 12:01

tonco


1 Answers

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);
        }
like image 110
user398482 Avatar answered Sep 22 '22 15:09

user398482