Try setting RibbonGallery.MaxColumnCount
to 1:
<RibbonGallery ... MaxColumnCount="1">
質問
I am working on some XAML where I have a RibbonComboBox:
<RibbonComboBox SelectionBoxWidth="150" Grid.Row="0">
<RibbonGallery SelectedItem="{Binding SelectedUtilityRun, Mode=TwoWay}">
<RibbonGalleryCategory ItemsSource="{Binding UtilityRunLabels}" />
</RibbonGallery>
</RibbonComboBox>
When it displays, it shows the items horizontally rather than vertically as I expected:
How do I style it to place the items vertically?
解決
Try setting RibbonGallery.MaxColumnCount
to 1:
<RibbonGallery ... MaxColumnCount="1">
他のヒント
Set ItemsPanel in Style and Set Orientation=Vertical
<Style TargetType="RibbonComboBox">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
</ItemsPanelTemplate>
</Setter.Value>
I hope this will help.