public static WindowPlacement GetWindowPlacement(this Window window) { WindowPlacement windowPlacement = new WindowPlacement(); WindowPlacementExtensions.GetWindowPlacement(new WindowInteropHelper(window).Handle, windowPlacement); return(windowPlacement); }
public static bool SetWindowPlacement(this Window window, WindowPlacement placement, bool restoreFromMinimizedState) { placement.Length = Marshal.SizeOf(typeof(WindowPlacement)); placement.Flags = 0; if (restoreFromMinimizedState) { placement.ShowCommand = ((placement.ShowCommand == 2) ? 1 : placement.ShowCommand); } return(WindowPlacementExtensions.SetWindowPlacement(new WindowInteropHelper(window).Handle, placement)); }