Не выводятся элементы ComboBox

Итак, у меня есть элементы ListBox, каждый из которых содержит ComboBox, но почему то, элементы последнего не выводятся, зато когда я , например, вывожу их количество в соседнем TextBlock то все правильно выводится. Вот разметка XAML:

<ListBox Grid.Row="1" ItemsSource="{Binding SearchProducts }"
                 SelectedItem="{Binding SelectedProduct}"
                 x:Name="listboxproducts">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Width="668">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="230"/>
                                <ColumnDefinition Width="438"/>
                            </Grid.ColumnDefinitions>
                            <Image Source="{Binding Image}" Grid.Column="0"/>
                            <StackPanel Grid.Column="1" Orientation="Vertical" >
                                <TextBlock Text="{Binding Name}" FontSize="16" FontWeight="Medium" 
                                           Foreground="White" HorizontalAlignment="Left" Width="438" Height="50"/>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
                                    <Button Background="#CD5C5C" Content="+"/>
                                    <Label Content="{Binding }" Margin="9,0,9,0"/>
                                    <Button Background="#CD5C5C" Content="-" FontSize="18"/>
                                </StackPanel>

                                <ComboBox ItemsSource="{Binding Sizes}" 
                                    SelectedItem="{Binding SelectedSize}"
                                    materialDesign:HintAssist.Hint="Size"
                                    FontSize="15" 
                                    Width="200"
                                    
                                    HorizontalAlignment="Center">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Name}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                                <Button Content="Add to cart"  Background="#FFE5C6C6" 
                                        VerticalAlignment="Bottom" Width="110" 
                                        Margin="0,10,0,0"
                                        Command="{Binding DataContext.AddToCartCommand, ElementName=listboxproducts}"
                                        CommandParameter="{Binding DataContext, ElementName=listboxproducts}"/>
                                <Button Content="Like" Background="#FFE5C6C6" 
                                        VerticalAlignment="Bottom"  Width="110" 
                                        Margin="0,10,0,0"
                                        Command="{Binding DataContext.AddToFavoriteCommand, ElementName=listboxproducts}"
                                        CommandParameter="{Binding DataContext, ElementName=listboxproducts}"/>
                            </StackPanel> 
                        </Grid>
                    </StackPanel>
                </DataTemplate>
                
            </ListBox.ItemTemplate>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>

UPDATED: мне нужно, чтобы у Listbox элемент мог содержать Combobox, например Listbox продуктов, и у каждого продукта ты мог выбрать размер.


Ответы (0 шт):