ComponentOne for WinUI
方向
コントロール > ListView > ListViewの使い方 > 方向

The Orientation property defines whether items are arranged vertically or horizontally.

XAML
コードのコピー
<Grid>
  <TextBlock Text="Orientation" FontSize="14" Margin="5"/>
  <ComboBox x:Name="cbOrientation" SelectedIndex="1" SelectionChanged="OnOrientationSelectionChanged" Width="100">
    <ComboBoxItem Content="Horizontal"/>
    <ComboBoxItem Content="Vertical"/>
  </ComboBox>
  <c1:C1ListView x:Name="listView" DisplayMemberPath="Name" Padding="10 0 0 0">
</Grid>
C#
コードのコピー
private void OnOrientationSelectionChanged(object sender, Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs e)
{
    if (listView != null)
    listView.Orientation = Enum.Parse<Orientation>((e.AddedItems[0] as ComboBoxItem).Content.ToString());
}