문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top