Repository navigation
[Proposal] Expander animation #2521
Copy link
Copy link
Open
Labels
approvedThis Proposal has been approved and is ready to be added to the ToolkitThis Proposal has been approved and is ready to be added to the ToolkitchampionA member of the .NET MAUI Toolkit core team has chosen to champion this featureA member of the .NET MAUI Toolkit core team has chosen to champion this featureproposalA fully fleshed out proposal describing a new feature in syntactic and semantic detailA fully fleshed out proposal describing a new feature in syntactic and semantic detail
Description
Feature name
Expander updated to support animation via a new ExpanderAnimationBehavior
public partial class ExpanderAnimationBehavior : BaseBehavior<Views.Expander>, IExpansionController
{
[BindableProperty] public partial Easing CollapsingEasing { get; set; } = Easing.Linear;
[BindableProperty] public partial uint CollapsingLength { get; set; } = 250u;
[BindableProperty] public partial Easing ExpandingEasing { get; set; } = Easing.Linear;
[BindableProperty] public partial uint ExpandingLength { get; set; } = 250u;
// ...
}Link to discussion
Progress tracker
- Android Implementation
- iOS Implementation
- MacCatalyst Implementation
- Windows Implementation
- Tizen Implementation
- Unit Tests
- Samples
- Documentation (TODO)
Summary
This issue and the corresponding PR is to continue a conversation that started in the discussion forums on how we may introduce animations to the Expander component.
Motivation
The Expander component could be improved to support animation.
Detailed Design
[Feb 15, 2025, Original Design]
[April 5, 2025, Refactor/Rewrite]
[March 2, 2026, Refactor/Rewrite]
Wrap the user's Expander.Content inside a new Expander.ContentHost (ContentView) so that we can implement expanding/collapsing animation by manipulating Expander.ContentHost.HeightRequest.
Usage:
<toolkit:Expander>
<!-- Expander.Header -->
<toolkit:Expander.Behaviors>
<toolkit:ExpanderAnimationBehavior>
</toolkit:Expander.Behaviors>
<!-- Expander.Content -->
</toolkit:Expander>Drawbacks
No response
Unresolved Questions
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
approvedThis Proposal has been approved and is ready to be added to the ToolkitThis Proposal has been approved and is ready to be added to the ToolkitchampionA member of the .NET MAUI Toolkit core team has chosen to champion this featureA member of the .NET MAUI Toolkit core team has chosen to champion this featureproposalA fully fleshed out proposal describing a new feature in syntactic and semantic detailA fully fleshed out proposal describing a new feature in syntactic and semantic detail
Type
Projects
- StatusShow more project fieldsProposal Approved
Activity
crwsolutions commentedon Mar 28, 2025
+1
Setting default to false is also fine for me (it might provide a better upgrade path), but I would prefer to simply have a switch that just works.
stephenquan commentedon Apr 3, 2025
From reading the above comments from @crwsolutions as well as #2522 (comment) there seems to be support for one of the solutions that I depicted in the "Alternatives". When there is free time, I will move the current implementation into a branch so that the main branch can be repurposed for this alternate solution.