Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Ribbon: Maximized window going off screen

Tags:

c#

.net

wpf

ribbon

I'm using the System.Windows.Controls.Ribbon library for my application. Everything is working really nice, except when I maximize the window it starts to go off screen.

I also noticed that with other WPF applications but when you use a RibbonWindow it gets worse.

enter image description here

Here is my source code (nothing really exciting i think):

<RibbonWindow 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="WpfApplication1.MainWindow"
        Title="TestWindow" Height="350" Width="525" Background="LightSteelBlue">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Ribbon Grid.Row="0">
            <RibbonTab x:Name="TestRibbon" Header="TestRibbon">
                <RibbonGroup>
                    <RibbonButton x:Name="TestButton" Label="Button" LargeImageSource="traffic_lights_green.png" />
                </RibbonGroup>
            </RibbonTab>
        </Ribbon>

        <ContentControl Grid.Row="1">
        </ContentControl>
    </Grid>
</RibbonWindow>

Is there some way to stop the window from doing this?

like image 449
Staeff Avatar asked Oct 09 '12 09:10

Staeff


1 Answers

If you have not already found it, I think this may answer your problem. systemmenu-does-not-show-correctly. It appears to be a bug specific to .net 4 implementation.

like image 112
Spevy Avatar answered Nov 17 '22 22:11

Spevy