http://stackoverflow.com/questions/4244793/listbox-not-showing-items-horizontally-after-using-theme

           <ListBox.ItemsPanel>

<ItemsPanelTemplate>

<WrapPane Orientation="Horizontal"l></WrapPanel>

</ItemsPanelTemplate>

</ListBox.ItemsPanel>

无法正常横向显示,原因应用了Theme,修改对应的Theml.xaml

<ControlTemplate TargetType="{x:Type ListBox}">
<Grid>
<Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Background="{DynamicResource ControlBackgroundBrush}" />
<ScrollViewer Margin="1" Style="{DynamicResource NuclearScrollViewer}" Focusable="false" Background="{x:Null}">
<StackPanel Margin="1,1,1,1" IsItemsHost="true" />
</ScrollViewer>
</Grid>

修改 StackPanel to an ItemsPresenter:

<ItemsPresenter Margin="1,1,1,1"/>






相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
  • 2021-10-02
猜你喜欢
  • 2021-08-12
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-10-28
  • 2022-12-23
相关资源
相似解决方案