誰かが私の問題で私を助けてくれることを願っていますItemsControl:)
MVVM (およびセル コンテンツ) で追加/削除するためにItemsControlaを使用しますが、これは正常に機能しますが、追加しようとするとスプリッターが表示されますが、機能しません。その理由は、アイテムごとに新しいものが追加されるためです...GridItemsPanelColumn/RowDefinitionsGridSplitterItemsControlContentPresenter
children プロパティの項目の が typeof の場合、ContentPresenterをGridSplitterControl に置き換える方法はありますか??TypeSplitterVM
Splittersまた、Gridを としてバインドしようとしていますが、に追加できないため、DependencyProperty使用すると機能しません...ItemsPanelChildrenPanel
これが私のコードです:
<DataTemplate DataType="{x:Type vm:GridVM}">
<ItemsControl ItemsSource="{Binding Children}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<view:LayoutGridControl Rows="{Binding Rows}" Columns="{Binding Columns}" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style>
<Setter Property="Grid.Row" Value="{Binding Model.RowIndex}"/>
<Setter Property="Grid.Column" Value="{Binding Model.ColumnIndex}"/>
<Setter Property="Grid.RowSpan" Value="{Binding Model.RowSpan}"/>
<Setter Property="Grid.ColumnSpan" Value="{Binding Model.ColumnSpan}"/>
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
</DataTemplate>