CommunityToolkit/Maui.Markup

[Proposal] FlexLayout Basis<T> extension method overload + Doc and samples

danielftz opened this issue · 4 comments

FlexLayout Basis extension method overload

Link to Discussion

#34

Summary

This proposal adds a method overload to the Basis<T> extension method, so that FlexBasis can be set without the need for instantiating a FlexBasis struct. Also samples and docs for the existing FlexLayout methods will be added.

Motivation

Allows for more options when declaring FlexBasis.

Detailed Design

public static TBindable Basis<TBindable>(this TBindable bindable, float length, bool isRelative = false) where TBindable : BindableObject
{
      return bindable.Basis(new FlexBasis(length, isRelative));
}

Usage Syntax

Content = new Label().Basis(25, true);

Drawbacks

None

Alternatives

None

Unresolved Questions

None

Thanks @danielftz! I approve this Proposal ✅

Once we get 3 total approval votes (ie a majority approval from the core team) we'll review + merge the Pull Request 🙌

I approve this feature ✅

Reopening Proposal.

Only Proposals moved to the Closed Project Column and Completed Project Column can be closed.