Esempio n. 1
0
        /// <summary>
        /// Updates the layout slot of the specified logical node, presented by the provided <see cref="FrameworkElement"/>.
        /// </summary>
        internal virtual void ArrangeUIElement(FrameworkElement presenter, RadRect layoutSlot, bool setSize = true)
        {
            if (presenter == null)
            {
                return;
            }

            presenter.AddTransform(new TranslateTransform()
            {
                X = layoutSlot.X, Y = layoutSlot.Y
            });

            if (setSize)
            {
                // We can have custom Canvas and to skip the Width/Height setting
                if (presenter.Width != layoutSlot.Width)
                {
                    presenter.Width = layoutSlot.Width;
                }
                if (presenter.Height != layoutSlot.Height)
                {
                    presenter.Height = layoutSlot.Height;
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the layout slot of the specified logical node, presented by the provided <see cref="FrameworkElement"/>.
        /// </summary>
        internal virtual void ArrangeUIElement(FrameworkElement presenter, RadRect layoutSlot, bool setSize = true)
        {
            if (presenter == null)
            {
                return;
            }

            presenter.AddTransform(new TranslateTransform()
            {
                X = layoutSlot.X, Y = layoutSlot.Y
            });

            if (setSize)
            {
                // TODO: We can have custom Canvas and to skip the Width/Height setting
                if (presenter.Width != layoutSlot.Width)
                {
                    presenter.Width = layoutSlot.Width;
                }
                if (presenter.Height != layoutSlot.Height)
                {
                    presenter.Height = layoutSlot.Height;
                }

                // TODO: This is very HACKY, investigate why this happens
                //if (!(presenter is Shape))
                //{
                //    presenter.InvalidateArrange();
                //    presenter.Arrange(layoutSlot.ToRect());
                //}
            }
        }