WPF水平项控件与usercontrol

WPF水平项控件与usercontrol,wpf,user-controls,itemscontrol,horizontallist,Wpf,User Controls,Itemscontrol,Horizontallist,我正试图设计一个水平的UserControls堆栈。在我的ViewModel中,我有一个名为MiniControl的UserControl和一个名为minivides的observeCollection。在窗口中我正试图将所有代码组合在一起,我有以下代码: <ItemsControl x:Name="items" Margin="5" ItemsSource="{Binding Path=MiniVideos}"> <ItemsControl.ItemsPanel>

我正试图设计一个水平的UserControls堆栈。在我的
ViewModel
中,我有一个名为
MiniControl
UserControl
和一个名为
minivides
observeCollection
。在
窗口中
我正试图将所有代码组合在一起,我有以下代码:

<ItemsControl x:Name="items" Margin="5" ItemsSource="{Binding Path=MiniVideos}">
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal" Background="LightGray"/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>

    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <ContentPresenter />
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

当我运行代码时,它没有按预期工作,并且在输出中出现以下错误:

System.Windows.Data错误:26:已为ItemsControl容器类型的项忽略ItemTemplate和ItemTemplateSelector;Type='MiniControl'

有什么想法吗