itemControl wpfを使用して、すべての楕円を同じポイントに表示したい。デフォルトでは、itemsControl は垂直スタックパネルを使用します。StackPanel を簡単に削除する方法はありますか?
ありがとう
itemControl wpfを使用して、すべての楕円を同じポイントに表示したい。デフォルトでは、itemsControl は垂直スタックパネルを使用します。StackPanel を簡単に削除する方法はありますか?
ありがとう
確かに、ItemsControl ControlTemplate でいずれかを設定し、IsItemsHost プロパティを使用して、どのパネルがアイテムのレシーバーであるかを示すことで、カスタムItemsPanelを与えることができます。
<ItemsControl.Template>
<ControlTemplate>
<Canvas IsItemsHost="True"/>
</ControlTemplate>
</ItemsControl.Template>
または、カスタム ItemsPanel を提供し、ItemsPresenter によってテンプレート内の位置を伝えることによって。
<ItemsControl.Template>
<ControlTemplate>
<ItemsPresenter/>
</ControlTemplate>
</ItemsControl.Template>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>