The Wayback Machine - https://web.archive.org/web/20211112174922/https://github.com/dotnet/maui/pull/3362
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Obsolete AndExpand #3362

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

[Proposal] Obsolete AndExpand #3362

wants to merge 5 commits into from

Conversation

@hartez
Copy link
Contributor

@hartez hartez commented Nov 11, 2021

For context, see the other discussions at #1702, #29, #1872, and #3324.

And also https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/layout-options#expansion

With this pull request I am proposing the following:

  1. The "AndExpand" options will not go into MAUI Core.
  2. The "AndExpand" options in Controls will be marked Obsolete
  3. The Controls implementation of StackLayout will, for the time being, honor the "AndExpand" options. We may choose to remove that capability in the future.
  4. No new form of the "AndExpand" options will be added to any future versions of Core or Controls.

This pull request marks all of the "AndExpand" LayoutOptions in Controls as Obsolete. Current usages are preserved with warnings disabled.

The pull request also adds "AndExpand" legacy capabilities to the new StackLayout. When the new StackLayout detects the use of "AndExpand" it will drop into a separate mode which lays out child views as expected. VerticalStackLayout and HorizontalStackLayout do not honor "AndExpand" - only StackLayout does this. This is to ease the transition for existing Xamarin.Forms applications.

All of the functionality provided by "AndExpand" is already available to layouts via the Grid, so no new attached properties or other StackLayout-specific properties are required.

This will achieve the following goals:

  • Reduce the confusion caused by "AndExpand"
  • Push users who want layouts which subdivide the container area to use the correct layout types
  • Preserve the speed and simplicity of the StackLayout types
  • Provide an easy transition from Forms to MAUI for users who have historically used the "AndExpand" options
  • Prevent future packaged templates from using/misusing the "AndExpand" options
@hartez hartez changed the title Obsolete AndExpand [Proposal] Obsolete AndExpand Nov 11, 2021
@jsuarezruiz jsuarezruiz added this to Ready for implementation in Enhancements Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment