예제 #1
0
        /// <summary>
        /// Handles the Loaded event of the CurrentWindow control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        protected void CurrentWindow_Loaded(object sender, RoutedEventArgs e)
        {
            var topBorder = this.currentWindow.GetWindowRootBorder();

            this.windowResizingAdorner = new WindowResizingAdorner((UIElement)topBorder, currentWindow);

            var adornerLayer = AdornerLayer.GetAdornerLayer((UIElement)topBorder);

            adornerLayer.Add(this.windowResizingAdorner);
        }
예제 #2
0
        private void InitializeResizingAdorner()
        {
            _resizingAdorner = new WindowResizingAdorner((UIElement)this.Content, this);

            var adorneLayer = AdornerLayer.GetAdornerLayer((UIElement)this.Content);

            if (adorneLayer == null)
            {
                return;
            }
            AdornerLayer.GetAdornerLayer((UIElement)this.Content).Add(_resizingAdorner);
        }