Class which helps in the layout management for the FluidWrapPanel
コード例 #1
0
        /// <summary>
        /// Override for the Arrange Layout Phase
        /// </summary>
        /// <param name="finalSize">Available size provided by the FluidWrapPanel</param>
        /// <returns>Size taken up by the Panel</returns>
        protected override Size ArrangeOverride(Size finalSize)
        {
            if (layoutManager == null)
            {
                layoutManager = new FluidLayoutManager();
            }

            // Initialize the LayoutManager
            layoutManager.Initialize(finalSize.Width, finalSize.Height, ItemWidth, ItemHeight, Orientation);

            bool isEasingRequired = !isInitializeArrangeRequired;

            // If the children are newly added, then set their initial location before the panel loads
            if ((isInitializeArrangeRequired) && (this.Children.Count > 0))
            {
                InitializeArrange();
                isInitializeArrangeRequired = false;
            }

            // Update the Layout
            UpdateFluidLayout(isEasingRequired);

            // Return the size taken up by the Panel's Children
            return(layoutManager.GetArrangedSize(fluidElements.Count, finalSize));
        }
コード例 #2
0
 /// <summary>
 /// Ctor
 /// </summary>
 public FluidWrapPanel()
 {
     fluidElements = new List<UIElement>();
     layoutManager = new FluidLayoutManager();
     isInitializeArrangeRequired = true;
 }
コード例 #3
0
        /// <summary>
        /// Override for the Arrange Layout Phase
        /// </summary>
        /// <param name="finalSize">Available size provided by the FluidWrapPanel</param>
        /// <returns>Size taken up by the Panel</returns>
        protected override Size ArrangeOverride(Size finalSize)
        {
            if (layoutManager == null)
                layoutManager = new FluidLayoutManager();

            // Initialize the LayoutManager
            layoutManager.Initialize(finalSize.Width, finalSize.Height, ItemWidth, ItemHeight, Orientation);

            bool isEasingRequired = !isInitializeArrangeRequired;

            // If the children are newly added, then set their initial location before the panel loads
            if ((isInitializeArrangeRequired) && (this.Children.Count > 0))
            {
                InitializeArrange();
                isInitializeArrangeRequired = false;
            }

            // Update the Layout
            UpdateFluidLayout(isEasingRequired);

            // Return the size taken up by the Panel's Children
            return layoutManager.GetArrangedSize(fluidElements.Count, finalSize);
        }
コード例 #4
0
 /// <summary>
 /// Ctor
 /// </summary>
 public FluidWrapPanel()
 {
     fluidElements = new List <UIElement>();
     layoutManager = new FluidLayoutManager();
     isInitializeArrangeRequired = true;
 }
コード例 #5
0
 /// <summary>
 /// Ctor
 /// </summary>
 public FluidWrapPanel()
 {
     fluidElements = new ObservableCollection<UIElement>();
     layoutManager = new FluidLayoutManager();
     isInitializeArrangeRequired = true;
 }