I Currently have a List<List<Path>>
where I would want to show the inner list in the combobox items. Roughly like this pseudo:
<ComboBox>
<ComboBoxItem Content="3 paths"/>
<ComboBoxItem Content="3 paths"/>
<ComboBoxItem Content="3 paths"/>
<ComboBoxItem Content="3 paths"/>
</Combobox>
EDIT: added images
This is how it looks now
And this is roughly how i want it
In the images each row is a list containing another list which has the triangles in it.
So if the outermost list has 4 list items in it, each with 3 paths i want them to be shown like the above. My setup right now is like this
Xaml:
<ComboBox ItemsSource="{Binding Path=AvailableCombinationsOfShape}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Path Data="{Binding Path=Data}" StrokeThickness="1" Stroke="Black"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Code behind:
AvailableCombinationsOfShape = new List<List<Path>>();
foreach (var combination in combinations)
{
var r = CombineShapes(GetImageShapes(), combination);
AvailableCombinationsOfShape.Add(r);
i++;
}
private List<Path> CombineShapes(List<SymbolShapeModel> shapes, int[] numbersNotToFill)
{
var pathList = new List<Path>();
foreach (var shape in shapes)
{
var p = new Path();
p.Data = shape.Shape;
pathList.Add(p);
}
return pathList;
}
With this, I get the first shape in each list to be displayed in the combobox but I would like to have all 3 shapes displayed.
My reason for wanting it like this is because I want to color some of the shapes in each of the combobox items. (imagine 3 squares. I want the first item to show square 1 and 2 colored, item 2 should show square 2 and 3 colored and the last item should show square 1 and 3 colored.)
Hope someone can help me! Thanks!