Class SingleItemLayout<T>
- Namespace
- Myra.Graphics2D.UI
- Assembly
- Myra.dll
A layout system for containers that hold a single child widget of a specific type.
public class SingleItemLayout<T> : ILayout where T : Widget
Type Parameters
TThe type of widget contained.
- Inheritance
-
SingleItemLayout<T>
- Implements
- Inherited Members
Constructors
SingleItemLayout(Widget)
Initializes a new instance of the SingleItemLayout<T> class with the specified container.
public SingleItemLayout(Widget container)
Parameters
containerWidgetThe container widget.
Exceptions
- ArgumentNullException
containeris null.
Properties
Child
Gets or sets the child widget.
public T Child { get; set; }
Property Value
- T
Methods
Arrange(IEnumerable<Widget>, Rectangle)
Arranges the child widget within the specified bounds.
public void Arrange(IEnumerable<Widget> widgets, Rectangle bounds)
Parameters
widgetsIEnumerable<Widget>The widgets to arrange (should contain the single child).
boundsRectangleThe bounds in which to arrange the child widget.
Measure(IEnumerable<Widget>, Point)
Measures the desired size of the child widget within the given available size.
public Point Measure(IEnumerable<Widget> widgets, Point availableSize)
Parameters
widgetsIEnumerable<Widget>The widgets to measure (should contain the single child).
availableSizePointThe available size for layout.
Returns
- Point
The desired size of the child widget, or zero if no child is present.