在全屏窗口上可见的背景

the*_*sys 6 wpf

当我点击全屏按钮时,我的WPF应用程序(使用Elysium Extra)在窗口右侧有一个边距:

在此输入图像描述

在右侧,您可以看到我的桌面背景.

我检查是否有保证金,但它设置为0 px所有方面.我也定了

this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
Run Code Online (Sandbox Code Playgroud)

App.xaml中:

<extra:ElysiumApplication x:Class="CTS.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:extra="http://schemas.extra.com/ui"
             xmlns:local="clr-namespace:CTS"
             Theme="Dark"
             StartupUri="MainWindow.xaml" />
Run Code Online (Sandbox Code Playgroud)

MainWindow.xaml:

<extra:Window x:Class="CTS.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:extra="http://schemas.extra.com/ui"
        xmlns:local="clr-namespace:CTS"
        mc:Ignorable="d"
        Title="..." Height="521.877" Width="1239.945" FontFamily="Open Sans" Foreground="#FF0970D1" Background="#FF22313F">

....
Run Code Online (Sandbox Code Playgroud)

编辑:我已经检查了Elysium Extra演示应用程序.它也有同样的问题,所以它似乎是由框架引起的.但是,我想继续使用它.

我怎样才能摆脱这个边际?

Fat*_*mòn 2

看看这个: http: //stackoverflow.com/a/24818071/4587181 它使用一些 Windows32 互操作来设置 Windows 边距。因为当你使用自己的自定义Window chrome(WindowStyle = None)时也会出现这个问题,我经历过。这个答案解决了它。祝你好运