using System; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Data; using System.Windows.Input; using System.Windows.Media; using HandyControl.Data; using HandyControl.Tools; using HandyControl.Tools.Extension; using HandyControl.Tools.Interop; #if NET40 using Microsoft.Windows.Shell; #else using System.Windows.Shell; #endif namespace HandyControl.Controls { [TemplatePart(Name = ElementNonClientArea, Type = typeof(UIElement))] public class Window : System.Windows.Window { #region fields private const string ElementNonClientArea = "PART_NonClientArea"; private bool _isFullScreen; private Thickness _actualBorderThickness; private readonly Thickness _commonPadding; private bool _showNonClientArea = true; private double _tempNonClientAreaHeight; private WindowState _tempWindowState; private WindowStyle _tempWindowStyle; private ResizeMode _tempResizeMode; private UIElement _nonClientArea; #endregion #region ctor static Window() { StyleProperty.OverrideMetadata(typeof(Window), new FrameworkPropertyMetadata(ResourceHelper.GetResourceInternal