Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions src/MahApps.Metro/Controls/MetroWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Automation.Peers;
Expand All @@ -18,6 +17,7 @@
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;
using System.Windows.Interop;
using Windows.Win32;
using Windows.Win32.Foundation;
using ControlzEx;
Expand Down Expand Up @@ -220,7 +220,7 @@ public static readonly DependencyProperty ShowFlyoutsOverDialogsProperty
if (d is MetroWindow window && window.Flyouts != null)
{
// It's not allowed to change this if any Flyout is open
// TODO Find a way to reset the zIndex of any open Flyout if <see cref="ShowFlyoutsOverDialogs"/> is changed by the user
// TODO Find a way to reset the zIndex of any open Flyout if <see cref="ShowFlyoutsOverDialogs"/> is changed by the user
var anyFlyoutOpen = window.Flyouts.GetFlyouts().Any(f => f.IsOpen);
if (anyFlyoutOpen)
{
Expand Down Expand Up @@ -1457,16 +1457,6 @@ protected override AutomationPeer OnCreateAutomationPeer()
return new MetroWindowAutomationPeer(this);
}

protected internal IntPtr CriticalHandle
{
get
{
this.VerifyAccess();
var value = typeof(Window).GetProperty("CriticalHandle", BindingFlags.NonPublic | BindingFlags.Instance)?.GetValue(this, new object[0]) ?? IntPtr.Zero;
return (IntPtr)value;
}
}

private void ClearWindowEvents()
{
if (this.windowTitleThumb != null)
Expand Down Expand Up @@ -1642,7 +1632,8 @@ internal static void DoWindowTitleThumbMoveOnDragDelta(IMetroThumb? thumb, Metro
var wpfPoint = window.PointToScreen(Mouse.GetPosition(window));
var x = (int)wpfPoint.X;
var y = (int)wpfPoint.Y;
PInvoke.SendMessage(new HWND(window.CriticalHandle), PInvoke.WM_NCLBUTTONDOWN, new WPARAM((nuint)HT.CAPTION), new IntPtr(x | (y << 16)));
var windowHandle = new WindowInteropHelper(window).EnsureHandle();
PInvoke.SendMessage(new HWND(windowHandle), PInvoke.WM_NCLBUTTONDOWN, new WPARAM((nuint)HT.CAPTION), new IntPtr(x | (y << 16)));
}

internal static void DoWindowTitleThumbChangeWindowStateOnMouseDoubleClick(MetroWindow window, MouseButtonEventArgs mouseButtonEventArgs)
Expand Down
Loading