6

My WPF application (with Elysium Extra) has a margin on the right side of the window when I click the fullscreen button:

enter image description here

On the right side you can see my desktop background.

I checked if there is a margin, but it is set to 0 px on all sides. I have also set

this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;

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" />

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">

....

Edit: I have checked the Elysium Extra demo application. It also has the same problem, so it seems like it is caused by the Framework. However, I'd like to keep on using it.

How can I get rid of this margin?

Bobface
  • 2,782
  • 4
  • 24
  • 61
  • Just throwing this out there. Try working out the thickness of margin and use a negative margin to compensate. – Nkosi Jun 25 '17 at 11:55
  • It seems the problem is deeper than Elysium-Extra, and is in Elysium. I can't find a way to recompile Elysium. The source here https://elysium.codeplex.com/SourceControl/latest does not compile AFAIK it's not been updated since 2013, and looking deeper at it, it uses a lot of window hacks related to window maximize (https://elysium.codeplex.com/SourceControl/latest). I wouldn't rely on this but anyway, I suggest the first thing you do is make sure you can recompile Elysium before goind any further. If you do that successfully, maybe you'll find the problem, or it will be easier for us to help – Simon Mourier Jun 25 '17 at 14:37

1 Answers1

2

Have a look at this: http://stackoverflow.com/a/24818071/4587181 It uses some Windows32 interop to set the Windows margins right. Because this problem also happens when you use your own custom Window chrome (WindowStyle = None), I experienced it. This SO answer solved it. Good luck

FatalJamòn
  • 386
  • 2
  • 10