Esempio n. 1
0
        /// <summary>
        /// When overridden in a derived class, positions child elements and determines a size for a <see cref="T:System.Windows.FrameworkElement"/> derived class.
        /// </summary>
        /// <param name="finalSize">The final area within the parent that this element should use to arrange itself and its children.</param>
        /// <returns>
        /// The actual size used.
        /// </returns>
        protected override Size ArrangeOverride(Size finalSize)
        {
            var location = new Point(0, 28);
            var size     = new Size(_ui.DesiredSize.Width, _ui.DesiredSize.Height);

            if (AdornedElement is FrameworkElement element)
            {
                location.Y = element.ActualHeight;
                size.Width = element.ActualWidth;
            }

            //_ui.Arrange(new Rect(location, _ui.DesiredSize));
            _ui.Arrange(new Rect(location, size));
            return(finalSize);
        }