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

DropDownButton should allow for group styles #3913

Closed
AKruimink opened this issue Aug 27, 2020 · 5 comments · Fixed by #3949
Closed

DropDownButton should allow for group styles #3913

AKruimink opened this issue Aug 27, 2020 · 5 comments · Fixed by #3949
Labels
Milestone

Comments

@AKruimink
Copy link

AKruimink commented Aug 27, 2020

Describe the feature

Currently it seems like the DropDownButton does not allow for grouping items together (as for example seen in the ComboBox).
The snipped below is an implementation of it in the Demo App, that should work, but doesnt seem like it does.

            <Controls:DropDownButton Margin="5"
                                     Content="Genres"
                                     DisplayMemberPath="Name"
                                     ItemsSource="{Binding Source={x:Static models:SampleData.Genres}}">
                <Controls:DropDownButton.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Name}"/>
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                    </GroupStyle>
                </Controls:DropDownButton.GroupStyle>
            </Controls:DropDownButton>

Additional context

@AKruimink
Copy link
Author

Might actualy be a bug report instead?

@timunie
Copy link
Collaborator

timunie commented Aug 28, 2020

I had a look in the source and it seems like this control uses ContextMenu to display the items. I think this needs to be changed, so it is for me a feature request and not a bug.
But this also enables SubMenus 🤔 So I am not sure if both can be supported.

@AKruimink
Copy link
Author

AKruimink commented Aug 28, 2020

Thanks for looking into it @timunie , had alook around as well, seems like you might be correct, not sure if it's worth in that case, as it would add a bunch of stuff that probably shouldn't be part of the button (unless there is some way around it, or incase anyone else is alright with it).

The only upside that it would create is a clearer list selection, nothing a Combobox can't handle, except that you won't have to deal with selected items (which was my initial reasoning)

@timunie
Copy link
Collaborator

timunie commented Aug 28, 2020

Maybe the SplitButton can be used for your need case?

@AKruimink
Copy link
Author

I had a look at the spitbutton yesterday, didn't offer much more to me then the dropdown button already did.
The optimal controller would have been the combobox, was it not for the hassle it introduces when trying to deselect an item from the viewmodel, thats wat got me to use the DropDownButton, i assumed it would offer support for headers (which i was wrong in).

That being said, i did some resorting of my list and it looks alot cleaner now even without the headers, and don't think would should change wat the DropDown is right now, and try to make it into a controller that it isn't/isn't suppoe to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants