简体   繁体   English

WPF功能区:最大化窗口关闭屏幕

[英]WPF Ribbon: Maximized window going off screen

I'm using the System.Windows.Controls.Ribbon library for my application. 我正在为我的应用程序使用System.Windows.Controls.Ribbon库。 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. 我还注意到,对于其他WPF应用程序,但是当您使用RibbonWindow ,情况会更糟。

在此处输入图片说明

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? 有什么方法可以阻止窗口执行此操作吗?

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. 它似乎是特定于.net 4实现的错误。

Just to let you know how I "solved" this. 只是让您知道我是如何“解决”此问题的。 I'm using the Fluent Ribbon api. 我正在使用Fluent Ribbon API。 Which works much better for me, also you get the Office 2010 Styles. 这对我来说效果更好,您也可以获得Office 2010样式。

But I highly recommend that you download the source code and compile it yourself because the last stable release was a while ago, but it's still under development and the developers respond very quickly to bugs. 但是我强烈建议您下载源代码并自己编译,因为最近的稳定版本是在不久前发布的,但是它仍在开发中,并且开发人员对错误的反应非常快。

http://fluent.codeplex.com/ http://fluent.codeplex.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM