Created
November 24, 2014 02:25
-
-
Save nigel-sampson/db65e0355b428ded315b to your computer and use it in GitHub Desktop.
Non scrolling combo box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ComboBox | |
ScrollViewer.HorizontalScrollBarVisibility="Disabled" | |
ScrollViewer.VerticalScrollBarVisibility="Disabled" | |
ScrollViewer.HorizontalScrollMode="Disabled" | |
ScrollViewer.VerticalScrollMode="Disabled"> | |
<ComboBox.ItemsPanel> | |
<ItemsPanelTemplate> | |
<StackPanel/> | |
</ItemsPanelTemplate> | |
</ComboBox.ItemsPanel> | |
</ComboBox> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This indeed delivers a ComboBox without the CarouselPanel, but then you lose all the nice inertia effects in touch mode.
Ideally, there would be a boolean property called AllowInfiniteScrolling which could be disabled.
For context, I have a SettingsFlyout with a bunch of comboboxes, most of which only contain 3 or 4 options in it. Until you reach some item count threshold, standard WinRT comboboxes behave without infinite scrolling. Add enough items to your combobox, and then infinite scrolling kicks in. Today is the day that one of those comboboxes now has enough items to trigger infinite scrolling, so now the visual behaviour is inconsistent with the other comboboxes on the view.
Thanks for supplying the gist though! For anyone who doesn't need the inertia effects, this will probably suit just fine. :)