Skip to content

OffsetX and OffsetY set to zero are not respected #2

Description

@punker76

Originally reported by @nicll at punker76#132

I'm creating a ChildWindow using the following code:

ChildWindowManager.ShowChildWindowAsync(Application.Current.MainWindow, dialogView, ChildWindowManager.OverlayFillBehavior.FullWindow);

Here, dialogView is defined in the following way:

<simpleChildWindow:ChildWindow x:Class="Test.ChildView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:simpleChildWindow="clr-namespace:MahApps.Metro.SimpleChildWindow;assembly=MahApps.Metro.SimpleChildWindow"
             ChildWindowWidth="{Binding Width, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
             ChildWindowHeight="{Binding Height, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
             OffsetX="0"
             OffsetY="0"
             ShowTitleBar="False">
...
</simpleChildWindow:ChildWindow>

As expected, the height and width of the ChildWindow are being set correctly to the same values as the main window.
However, the OffsetX and OffsetY values are being overriden after initialization of the view, causing the ChildWindow to not fill the entire main window.
I assume this is caused by the logic in the ProcessMove method of the ChildWindow.cs class (https://github.com/punker76/MahApps.Metro.SimpleChildWindow/blob/develop/src/MahApps.Metro.SimpleChildWindow/ChildWindow.cs#L1139)

I am using version 2.2.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions