コード例 #1
0
        public static void SetWindowChromeResizeGripDirection(this MetroWindow window, string name, ResizeGripDirection direction)
        {
            if (window == null)
            {
                return;
            }
            IInputElement part = window.GetPart(name) as IInputElement;

            if (part != null)
            {
                WindowChrome.SetResizeGripDirection(part, direction);
            }
        }
コード例 #2
0
        /// <summary>
        /// Sets the WindowChrome ResizeGripDirection to a CrystalWindow template child.
        /// </summary>
        /// <param name="window">The CrystalWindow.</param>
        /// <param name="name">The name of the template child.</param>
        /// <param name="direction">The direction.</param>
        public static void SetWindowChromeResizeGripDirection([NotNull] this CrystalWindow window, string name, ResizeGripDirection direction)
        {
            if (window is null)
              {
            throw new ArgumentNullException(nameof(window));
              }

              var inputElement = window.GetPart<IInputElement>(name);
              Debug.Assert(inputElement != null, $"{name} is not a IInputElement");
              if (inputElement is not null && WindowChrome.GetResizeGripDirection(inputElement) != direction)
              {
            WindowChrome.SetResizeGripDirection(inputElement, direction);
              }
        }
コード例 #3
0
        /// <summary>
        /// Sets the WindowChrome ResizeGripDirection to a MetroWindow template child.
        /// </summary>
        /// <param name="window">The MetroWindow.</param>
        /// <param name="name">The name of the template child.</param>
        /// <param name="direction">The direction.</param>
        public static void SetWindowChromeResizeGripDirection(this MetroWindow window, string name, ResizeGripDirection direction)
        {
            if (window == null)
            {
                throw new ArgumentNullException(nameof(window));
            }
            var inputElement = window.GetPart(name) as IInputElement;

            Debug.Assert(inputElement != null, $"{name} is not a IInputElement");
            if (WindowChrome.GetResizeGripDirection(inputElement) != direction)
            {
                WindowChrome.SetResizeGripDirection(inputElement, direction);
            }
        }
コード例 #4
0
ファイル: WindowBase.cs プロジェクト: bytecode77/pe-union
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);

            WindowChrome.SetResizeGripDirection(this.FindChild <ResizeGrip>(UITreeType.Visual, child => true), ResizeGripDirection.BottomRight);
        }