私はいくつかの拘束力のある問題を抱えています...
Shapes は、カスタマイズされた UserControl のリストです。たとえば、これらの UserControl の 1 つは、いくつかの特定のプロパティを持つ Ellipse にすることができます。私の目標は、このリストをループして、すべての UserControls を表示することです (Ellipse または Rectangle にすることができます)。
ここに私のグリッドがあります。DataTemplate に何を入れたらよいかわかりません。いくつかの異なることを試しましたが、実際には何も機能しませんでした。助けてくれることを願っています:)
<Grid>
<s:ScatterView ItemsSource="{Binding Shapes}">
<s:ScatterView.ItemContainerStyle>
<Style TargetType="s:ScatterViewItem">
<Setter Property="Background" Value="Transparent"></Setter>
</Style>
</s:ScatterView.ItemContainerStyle>
<s:ScatterView.ItemTemplate>
<DataTemplate>
<class:Shape ShapeItem="{Binding}" />
</DataTemplate>
</s:ScatterView.ItemTemplate>
</s:ScatterView>
</Grid>