-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[NET10] Make VisualElement.ComputeConstraintForView and LayoutConstraint enum public #28897
Description
Description
Enable custom layouts to specify whether a given child is being constrained on a fixed size.
Public API Changes
- Make
ComputeConstraintForViewjustprotected virtual
maui/src/Controls/src/Core/VisualElement/VisualElement.cs
Lines 1386 to 1388 in d988ddf
internal virtual void ComputeConstraintForView(View view) => view.ComputedConstraint = LayoutConstraint.None; - Make
LayoutConstraintpublic
maui/src/Controls/src/Core/LayoutConstraint.cs
Lines 6 to 12 in d988ddf
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status