-
Notifications
You must be signed in to change notification settings - Fork 985
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
Add Collapse Support to ListViewGroup #3067
Comments
It will be needed to be presented though accessibility API that you can toggle the collapsed state of a group. |
We'll need to see if we can expose the UIA Expand/Collapse pattern. You can chat with @M-Lipin for suggestions when you're at that point. |
I've scanned the neighbouring API and the
so the proposal to add the following fits right in:
It should be noted that I believe we should follow the former naming than the latter. |
When we approved it, I wrote this in email:
The mental model I had in mind was something simple like this: public bool Collapsible
{
get => _collapsible;
set
{
if (_collapsible != value)
{
_collapsible = true;
UpdateGroupState();
}
}
}
public bool Collapsed
{
get => _collapsed;
set
{
if (_collapsed != value)
{
_collapsed = true;
UpdateGroupState();
}
}
}
private void UpdateGroupState()
{
// Use _collapsible && _collapsed
} |
Yes, it is something I had in mind too. The new proposal is to meld the two properties into one, thus reducing the API surface and make it easier for a developer: public enum CollapsedState
{
None = 0,
Expanded, // collapsible
Collapsed, // collapsible | collapsed
}
public CollapsedState CollapsedState
{
get => _collapsedState;
set
{
if (_collapsedState!= value)
{
_collapsedState = value;
OnCollapsedStateChanged(value);
UpdateGroupState();
}
}
}
public EventHandler<ListViewGroupCollapsedStateArgs> CollapsedStateChanged(ListViewGroupCollapsedStateArgs e); |
Fixes #3067 ListViewGroup originally was not collapsible and thus items in the group could not be temporarily hidden. These changes add a new property to ListViewGroup which controls its appearance e.g. whether the group is collapsible and if the group is in its collapsed state or expanded state. These changes also raise an event for when the CollapsedState of a group is changed.
Fixes #3067 ListViewGroup originally was not collapsible and thus items in the group could not be temporarily hidden. These changes add a new property to ListViewGroup which controls its appearance e.g. whether the group is collapsible and if the group is in its collapsed state or expanded state. These changes also raise an event for when the CollapsedState of a group is changed.
Fixes #3067 ListViewGroup originally was not collapsible and thus items in the group could not be temporarily hidden. These changes add a new property to ListViewGroup which controls its appearance e.g. whether the group is collapsible and if the group is in its collapsed state or expanded state. These changes also raise an event for when the CollapsedState of a group is changed.
Is your feature request related to a problem? Please describe.
As of now, there's not an option for a user to hide items under a
ListViewGroup
that they aren't interested in seeing at the time, similar to what windows like File Explorer provide. This could result in endless scrolling if there are many ListViewGroups and many items under each group. As #2623 suggested, a collapsible/collapse property would be a nice touch to give users flexibility and can especially be useful for clutter management purposes.Describe the solution you'd like
Add the ability for users to make items in a group collapsible.
API:
Example:
An excellent visualization of what this might look like from the original issue:
Will this feature affect UI controls?
Yes.
Will VS Designer need to support the feature?
It would be nice. I would imagine the Designer would have an area carved out in the ListViewGroup Collection Editor where Collapsible/Collapsed can be toggled. Something like so:
I also imagine that the changes would immediately visible to the user in the designer, again similar to what is shown in the original issue.
What impact will it have on accessibility?
I'm not quite sure here.
Will this feature need to be localized or be localizable?
Aside from some work relating to accessibility namely perhaps what a talkback would use to describe the property, no I do not think this needs to be localized/localizable.
Update
After implementing Collapsible/Collapsed property for ListViewGroup as done so in #3155 , we realize that this will be an issue with the design-time serializer, which orders properties assignment statement alphabetically. This means that
Collapsed
will come beforeCollapsible
.Suppose a user wanted to set the properties like so in designer:
The serializer will generate:
Since Collapsed is no-op when
Collapsible = false
(which is the default), the end result will beCollapsed = false
andCollapsible = true
, not what the user intended.Suggestion
Upon discussion with the team, we came to the idea to merge the two properties into one. The new API will be as follows:
The text was updated successfully, but these errors were encountered: