Ejemplo n.º 1
0
        /// <summary>
        /// Arranges the <see cref="UIElement"/> for hte specified <see cref="Rect"/>
        /// bounds.
        /// </summary>
        /// <param name="element">
        /// The <see cref="UIElement"/> to arrange.
        /// </param>
        /// <param name="bounds">
        /// The <see cref="Rect"/> bound for the element.
        /// </param>
        protected void ArrangeElement(UIElement element, Rect bounds)
        {
            if (element == null)
            {
                return;
            }

            if (!renderingListener.IsListening)
            {
                renderingListener.StartListening();
            }

            ItemAnimationData animationData = GetAnimationData(element);

            if (animationData == null)
            {
                animationData = new ItemAnimationData();
                SetAnimationData(element, animationData);

                element.RenderTransform = animationData.Transform;
                animationData.Current   = OnElementAdded(element, bounds);
            }
            animationData.Target = bounds.Location;

            element.Arrange(bounds);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Measures all child sizes for the specified <see cref="Size"/>.
        /// </summary>
        /// <param name="availableSize">
        /// The available size.
        /// </param>
        /// <returns>
        /// The measured size for all child items.
        /// </returns>
        protected override Size MeasureOverride(Size availableSize)
        {
            Size size = new Size();

            UIElement child = Child;

            if (child != null)
            {
                listener.StartListening();
                child.Measure(availableSize);
            }

            return(size);
        }