Pregunta

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: enter image description here

How do I style it to place the items vertically?

¿Fue útil?

Solución

Try setting RibbonGallery.MaxColumnCount to 1:

<RibbonGallery ... MaxColumnCount="1">

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top