Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 如何绑定到ItemsControl中的项?_Wpf_Silverlight - Fatal编程技术网

Wpf 如何绑定到ItemsControl中的项?

Wpf 如何绑定到ItemsControl中的项?,wpf,silverlight,Wpf,Silverlight,我写了一些控件,其中包含itemsControl。 控件中的每个项都是我编写的某个UserControl 我想在项目源和我持有的某个集合之间进行绑定: Itemscontrol: <ItemsControl x:Name="itemsControl" Background="White" > <ItemsControl.Template> <ControlTemplate> &l

我写了一些控件,其中包含itemsControl。 控件中的每个项都是我编写的某个UserControl

我想在项目源和我持有的某个集合之间进行绑定:

Itemscontrol:

    <ItemsControl  x:Name="itemsControl" Background="White" >
        <ItemsControl.Template>
            <ControlTemplate>
                <ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}" >
                    <ItemsPresenter />
                </ScrollViewer>
            </ControlTemplate>
        </ItemsControl.Template>
    </ItemsControl>

我要绑定的集合是一些列表,其中包含将用于创建某些“usercontrol”的对象,这些“usercontrol”将添加到itemsControl


我怎么做?(我尝试绑定到ItemSource,但我不知道如何正确地绑定)

只要看看think链接就可以了