Click here to Skip to main content
15,940,271 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a WPF application that I have implemented the OfficeUI RibbonWindow. The problem that I am having is that when I maximize the window, the Ribbon covers up the Close, Minimize and Maximize buttons. When the form is not maximized, the buttons appear as normal. I cannot figure out how to stop it from doing this. Could it have something to do with my row definition height being set to Auto? I am very new to WPF and XAML, so any help would be appreciated.

XML
<r:ribbonwindow xmlns:r="#unknown">
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
    x:Class="RecipeOrganizer.MainWindow"
    x:Name="Window"
    Title="Recipes"
    Height="707" Width="740" xmlns:my="clr-namespace:RecipeOrganizer" Loaded="Window_Loaded">
    
    
    <r:ribbonwindow.resources>        
        <resourcedictionary>
            <resourcedictionary.mergeddictionaries>
                <resourcedictionary source="/RibbonControlsLibrary;component/Themes/Office2007Blue.xaml" />
            </resourcedictionary.mergeddictionaries>
                
            <r:ribboncommand x:key="ClipboardGroupCommand" xmlns:x="#unknown">
                CanExecute="OnCanExecute"
                Executed="OnShowClipboardGroup"
                LabelTitle="Clipboard"/>
            <r:ribboncommand x:key="CopyCommand">
                CanExecute="OnCanExecute"
                LabelTitle="Copy"
                LargeImageSource="Images\Copy2.png"
                ToolTipDescription="Copy the selection to the Clipboard."
                ToolTipTitle="Copy (Ctrl+C)"/>
            <r:ribboncommand x:key="PasteCommand">
                CanExecute="OnCanExecute"
                LabelTitle="Paste"
                LargeImageSource="Images\Paste.png"
                ToolTipDescription="Paste the selection from the Clipboard."
                ToolTipTitle="Paste (Ctrl+V)"/>
            <r:ribboncommand x:key="CutCommand">
                CanExecute="OnCanExecute"
                LabelTitle="Cut"
                LargeImageSource="Images\Cut.png"
                ToolTipDescription="Cut the selection."
                ToolTipTitle="Cut (Ctrl+X)"/>
            
            <my:recipedataset x:key="recipeDataSet" xmlns:my="#unknown" />
            <collectionviewsource x:key="getAllCookbooksAndRecipesViewSource" source="{Binding Path=GetAllCookbooksAndRecipes, Source={StaticResource recipeDataSet}}" />

            <datatemplate x:key="TreeTemplateDetail">
                <textblock text="{Binding Source={StaticResource getAllCookbooksAndRecipesViewSource}, Path=RecipeName}" />
            </datatemplate>

            <hierarchicaldatatemplate x:key="MasterTemplate" itemssource="{Binding  Path=getAllCookbooksAndRecipesViewSource}" itemtemplate="{StaticResource TreeTemplateDetail}">
                <textblock text="{Binding Source={StaticResource getAllCookbooksAndRecipesViewSource}, Path=CookBook}" />                
            </hierarchicaldatatemplate>

        </r:ribboncommand></r:ribboncommand></r:ribboncommand></r:ribboncommand></resourcedictionary>

        
    </r:ribbonwindow.resources>
    
    <grid x:name="LayoutRoot" xmlns:x="#unknown">
        <grid.rowdefinitions>
            <rowdefinition height="Auto"></rowdefinition>
            <rowdefinition></rowdefinition>
        </grid.rowdefinitions>
        <grid.columndefinitions>
            <columndefinition width="Auto" minwidth="150"></columndefinition>
            <columndefinition></columndefinition>
        </grid.columndefinitions>

        <r:ribbon title="Organizer" x:name="mainRibbon" height="Auto" grid.columnspan="2">
            <r:ribbon.applicationmenu>
                <r:ribbonapplicationmenu>

                    <r:ribbonapplicationmenuitem>
                        <r:ribbonapplicationmenuitem.command>
                            <r:ribboncommand labeltitle="_Save">
                                             LargeImageSource="images\save2.png" 
                                             Executed="Save_Executed" />
                        </r:ribboncommand></r:ribbonapplicationmenuitem.command>

                    </r:ribbonapplicationmenuitem>

                    <r:ribbonapplicationmenuitem>
                        <r:ribbonapplicationmenuitem.command>
                            <r:ribboncommand labeltitle="_Close">
                                             LargeImageSource="images\Close.png" 
                                             Executed="Close_Executed" />
                        </r:ribboncommand></r:ribbonapplicationmenuitem.command>
                    </r:ribbonapplicationmenuitem>

                    <r:ribbonapplicationmenuitem>
                        <r:ribbonapplicationmenuitem.command>
                            <r:ribboncommand labeltitle="_Print">
                                             LargeImageSource="images\Printer.png" 
                                             Executed="Print_Executed" />
                        </r:ribboncommand></r:ribbonapplicationmenuitem.command>
                    </r:ribbonapplicationmenuitem>

                    
                </r:ribbonapplicationmenu>
            </r:ribbon.applicationmenu>
            
            <r:ribbontab label="Home">
                <r:ribbongroup name="Clipboard" hasdialoglauncher="True" command="{StaticResource ClipboardGroupCommand}">
                    <r:ribbonbutton command="{StaticResource CopyCommand}"></r:ribbonbutton>
                    <r:ribbonbutton command="{StaticResource PasteCommand}"></r:ribbonbutton>
                    <r:ribbonbutton command="{StaticResource CutCommand}"></r:ribbonbutton>
                </r:ribbongroup>
            </r:ribbontab>

            <r:ribbontab label="Recipes" />
            <r:ribbontab label="Menus" />
            <r:ribbontab label="Shopping" />
            <r:ribbontab label="Options" />
            <r:ribbontab label="Tools" />
        </r:ribbon>

        <tabcontrol grid.row="1" grid.column="0" name="tabControlCookBook" margin="0,0,5,0">
            <tabitem name="tabCookBooks" header="My Library">
                <treeview name="treeView1" datacontext="{StaticResource getAllCookbooksAndRecipesViewSource}" itemssource="{Binding}" itemtemplate="{StaticResource MasterTemplate}" removed="White" width="Auto" margin="0,0,5,0" />                
            </tabitem>            
        </tabcontrol>

        <gridsplitter grid.row="1" grid.column="0" horizontalalignment="Right" removed="Silver" width="5" />

        <tabcontrol grid.row="1" grid.column="1" name="tabOther">
            <tabitem name="tabView" header="View">
                <webbrowser height="Auto" horizontalalignment="Left" name="webBrowser1" verticalalignment="Top" width="Auto" />
            </tabitem>
            <tabitem name="tabEdit" header="Edit">
                <webbrowser height="Auto" horizontalalignment="Left" name="webBrowser2" verticalalignment="Top" width="Auto" />
            </tabitem>
        </tabcontrol>
        
    </grid>
</r:ribbonwindow>
Posted
Updated 23-Aug-11 9:23am
v2

1 solution

My guess is it's a bug in the ribbon library you use. I can suggest using Fluent Ribbon[^], I use it myself and had any problems.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900