C# コードで Orientation を ListBox に設定する必要があります。次の XAML コードと同じ結果が必要です。
<ListBox>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
私はこれを持っています:
ListBox elementListBox = new ListBox();
StackPanel pomocnyStackPanel = new StackPanel();
pomocnyStackPanel.Orientation = Orientation.Horizontal;
「ItemsPanel」を追加するには?