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: Add the Ability to Cancel Expand/Collapse of the Expander #4407

Closed
robloo opened this issue Mar 3, 2021 · 1 comment
Closed

Proposal: Add the Ability to Cancel Expand/Collapse of the Expander #4407

robloo opened this issue Mar 3, 2021 · 1 comment
Assignees
Labels
area-Expander feature proposal New feature proposal team-Controls Issue for the Controls team wct

Comments

@robloo
Copy link
Contributor

robloo commented Mar 3, 2021

Proposal: Add the Ability to Cancel Expand/Collapse of the Expander

Summary

In some cases it is necessary to programmatically override user selection and cancel either expanding or collapsing the Expander control (specific case described below).

In order to support this, the following Events/Properties should be added:

/// <summary>
/// Gets or sets a value indicating whether the expander is pinned to its current state (either expanded or collapsed).
/// The toggle button to change state will be disabled.
/// </<summary>
bool IsPinned;

/// <summary>
/// Event fired before the control is expanded.
/// This allows cancelling the expand operation.
/// </summary>
event TypedEventHandler<Expander, ExpanderExpandingEventArgs> Expanding;

/// <summary>
/// Event fired before the control is collapsed.
/// This allows cancelling the collapse operation.
/// </summary>
event TypedEventHandler<Expander, ExpanderCollapsingEventArgs> Collapsing;

Cancellation and the Expanding/Collapsing events should follow what is done in Flyout and FlyoutBaseClosingEventArgs.

Rationale

This functionality is needed, for example, in the following use-case:

When there are many properties in an editor it is common to group them and put them in an accordion-style layout with Expanders stacked on top of one another. In my case, to save space, only one Expander should be opened at a time in the accordion. However, at least one expander should always be opened to show something to the user.

The closing event with cancelation is necessary to ensure the currently expanded expander in the accordion is never closed. It is only closed when another expander is expanded.

Further discussed: #4390 (comment) and #3279 (comment)

Scope

Capability Priority
Expanding event Must
Collapsing event Must
IsPinned Should

Important Notes

Also see:

@robloo robloo added the feature proposal New feature proposal label Mar 3, 2021
@ghost ghost added this to Freezer in Feature tracking Mar 3, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 3, 2021
@StephenLPeters StephenLPeters added area-Expander team-Controls Issue for the Controls team labels Mar 4, 2021
@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Mar 4, 2021
@robloo
Copy link
Contributor Author

robloo commented Jul 19, 2023

In separate discussions the team wanted exact use cases and I discussed this at length starting here: #4390 (comment)

It doesn't seem at all like Microsoft is willing to implement this unless they need it themselves. Therefore, closing.

@robloo robloo closed this as completed Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Expander feature proposal New feature proposal team-Controls Issue for the Controls team wct
Projects
Development

No branches or pull requests

4 participants