Ich mache eine Liste von Produkten, die innerhalb einer Listbox angezeigt werden, die horizontal scrollt. Ich habe die Liste horizontal scrollen, aber ich bekomme immer nur 1 Reihe von Elementen, obwohl das Listenfeld hoch genug ist, um 2 Zeilen zu füllen, bevor es horizontal scrollt.WPF Horizontale Listbox vertikal füllen
Teil meines WPF-Codes.
<DataTemplate x:Key="productTemplate">
<WrapPanel Orientation="Horizontal" Width="10" Height="10">
<Image Source="{Binding Photo}" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" Width="288" Height="320"/>
<Label Content="{Binding Name}" />
<Label Content="{Binding Cost}" />
</WrapPanel>
</DataTemplate>
<ListBox Width="1334" ItemsSource="{Binding Products}" SelectedItem="{Binding SelectedProduct}" ItemTemplate="{DynamicResource productTemplate}" Height="865" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" BorderThickness="0">
<ListBox.Background>
<SolidColorBrush Color="White" Opacity="0.85"/>
</ListBox.Background>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Ich suche nach:
Jede Hilfe wäre toll.
Verdammt nab es war ich so nah diese ¬¬ Prost (y) zu versuchen, – Sjc311