ItemsControl
UserControl としてテンプレート化された項目があります。MyItemsControl.Items
Panel
は としてテンプレート化されていCanvas
ます。
今のところ、これらのユーザーコントロールの幅と高さのプロパティを手動で設定すると、次のようになります。
<ItemsControl x:Name="curveList"
ItemsSource="{Binding SplineVMList}"
Background="{x:Null}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas x:Name="canvas" Margin="46,60,83,46"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<local:SplineControl Width="300" Height="300" Canvas.Bottom="0" Canvas.Left="0" IsSelected="{Binding IsSelected, Mode=TwoWay}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Canvas.Bottom" Value="0"/>
<Setter Property="Canvas.Left" Value="0"/>
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
私が欲しいのは、ユーザーコントロールの幅と高さのプロパティをキャンバスのプロパティにバインドすることです。それは可能ですか?