Description
Enable custom layouts to specify whether a given child is being constrained on a fixed size.
Public API Changes
- Make
ComputeConstraintForView just protected virtual
|
|
|
internal virtual void ComputeConstraintForView(View view) => view.ComputedConstraint = LayoutConstraint.None; |
|
|
- Make
LayoutConstraint public
|
internal enum LayoutConstraint |
|
{ |
|
None = 0, |
|
HorizontallyFixed = 1 << 0, |
|
VerticallyFixed = 1 << 1, |
|
Fixed = HorizontallyFixed | VerticallyFixed |
|
} |
Intended Use-Case
In MAUI it's super easy to build new custom layouts, and sometimes layout may constrain a given children on the horizontal or vertical axis, so that even when the measure of that child changes, there's no need to invalidate the entire hierarchy.
This could enable MAUI to highly reduce the number of layout passes.
A step in this direction has been made on #28479 and #28756, where on the latter we moved ComputeConstraintForView call to VisualElement measure invalidation.
Description
Enable custom layouts to specify whether a given child is being constrained on a fixed size.
Public API Changes
ComputeConstraintForViewjustprotected virtualmaui/src/Controls/src/Core/VisualElement/VisualElement.cs
Lines 1386 to 1388 in d988ddf
LayoutConstraintpublicmaui/src/Controls/src/Core/LayoutConstraint.cs
Lines 6 to 12 in d988ddf
Intended Use-Case
In MAUI it's super easy to build new custom layouts, and sometimes layout may constrain a given children on the horizontal or vertical axis, so that even when the measure of that child changes, there's no need to invalidate the entire hierarchy.
This could enable MAUI to highly reduce the number of layout passes.
A step in this direction has been made on #28479 and #28756, where on the latter we moved
ComputeConstraintForViewcall toVisualElementmeasure invalidation.