30 using System.Collections.Generic;
31 using System.ComponentModel;
51 [EditorBrowsable(EditorBrowsableState.Never)]
114 [EditorBrowsable(EditorBrowsableState.Never)]
117 if (objects.Count == 0)
121 double heightOfExpandingObjects = 0;
122 double heightOfFixedSizeObjects = 0;
126 foreach (var o
in objects)
128 if (o.PreferredSize.X > maxWidth)
130 maxWidth = o.PreferredSize.X;
133 if (o.VerticalSizing ==
Sizing.Expanding)
135 verticalSizing =
Sizing.Expanding;
136 heightOfExpandingObjects += o.PreferredSize.Y;
138 else if (o.VerticalSizing ==
Sizing.FixedSize)
140 heightOfFixedSizeObjects += o.PreferredSize.Y;
143 if (o.HorizontalSizing !=
Sizing.FixedSize)
145 horizontalSizing =
Sizing.Expanding;
159 [EditorBrowsable(EditorBrowsableState.Never)]
165 [EditorBrowsable(EditorBrowsableState.Never)]
171 [EditorBrowsable(EditorBrowsableState.Never)]
177 [EditorBrowsable(EditorBrowsableState.Never)]
183 double fixedScale = 1.0;
184 double expandingScale = 0.0;
186 double availableSpaceForObjects = contentHeight - (objects.Count - 1) *
Spacing;
219 foreach (var o
in objects)
221 double scale = (o.VerticalSizing ==
Sizing.FixedSize) ? fixedScale : expandingScale;
222 double height = o.PreferredSize.Y * scale;
223 double width = o.PreferredSize.X;
225 if ((o.PreferredSize.X > contentWidth) || (o.HorizontalSizing ==
Sizing.Expanding))
227 width = contentWidth;
230 o.Size =
new Vector(width, height);
231 o.X = (-maximumSize.X / 2) + (
LeftPadding + contentWidth / 2);
232 o.Y = top - height / 2;