具有不同索引集合项的所有绑定都会同时更新WPF

具有不同索引集合项的所有绑定都会同时更新WPF,wpf,binding,wpf-controls,Wpf,Binding,Wpf Controls,我的WPF视图中有这样的代码 <!--Column 2--> <Border Grid.Column="1" Grid.Row="1" > <TextBox x:Name="textB2BR0K2" Text="{Binding Path=ListBlok2B[0].B2B1}" /> </Border> <TextBox x:Name="textB2BR1AK2" Grid.Column="1

我的WPF视图中有这样的代码

    <!--Column 2-->
    <Border Grid.Column="1" Grid.Row="1" >
        <TextBox x:Name="textB2BR0K2" Text="{Binding Path=ListBlok2B[0].B2B1}" />
    </Border>
    <TextBox x:Name="textB2BR1AK2" Grid.Column="1" Grid.Row="4" Text="{Binding Path=ListBlok2B[0].B2BR1A}"/>
    <TextBox x:Name="textB2BR1BK2" Grid.Column="1" Grid.Row="5" Text="{Binding Path=ListBlok2B[0].B2BR1B}"/>
    <TextBox x:Name="textB2BR1CK2" Grid.Column="1" Grid.Row="6" Text="{Binding Path=ListBlok2B[0].B2BR1C}"/>

    <!--Column 3-->
    <Border Grid.Column="2" Grid.Row="1" >
        <TextBox x:Name="textB2BR0K3" Text="{Binding Path=ListBlok2B[1].B2B1}" />
    </Border>
    <TextBox x:Name="textB2BR1AK3" Grid.Column="2" Grid.Row="4" Text="{Binding Path=ListBlok2B[1].B2BR1A}"/>
    <TextBox x:Name="textB2BR1BK3" Grid.Column="2" Grid.Row="5" Text="{Binding Path=ListBlok2B[1].B2BR1B}"/>
    <TextBox x:Name="textB2BR1CK3" Grid.Column="2" Grid.Row="6" Text="{Binding Path=ListBlok2B[1].B2BR1C}"/>

然后我从我收集的数据库中填写了这个字段,并且工作正常。但是当我尝试更改其中一个值时,所有具有一些绑定属性的数据都会同时更改
ListBlok2B[0].B2BR1A
ListBlok2B[1].B2BR1A
在尝试在其内部编辑时会同时更改


有人知道怎么解决这个问题吗?我希望它绑定到我拥有的不同索引集合中,这样我就可以将它插入我的数据库
context.Blok2Bs.insertAllOnSubmit(ListBlok2B)
为什么不使用itemscontrol并将集合绑定到它

 <ItemsControl ItemsSource="{Binding ListBlok2B}>
   <ItemsControl.ItemTemplate>
    <DataTemplate>     
     <Grid>
      <Border Grid.Column="1" Grid.Row="1" >
         <TextBox x:Name="textB2BR0K2" Text="{Binding Path=B2B1}" />
      </Border>
      <TextBox Grid.Column="1" Grid.Row="4" Text="{Binding Path=B2BR1A}"/>
      <TextBox Grid.Column="1" Grid.Row="5" Text="{Binding Path=B2BR1B}"/>
      <TextBox Grid.Column="1" Grid.Row="6" Text="{Binding Path=B2BR1C}"/>

      </Grid>
    </DataTemplate>
   </ItemsControl.ItemTemplate>
 </ItemsControl>

我昨天也尝试了使用itemscontrol,但问题是我的控件是用gridlayout创建的表中的布局。。它有一个标题。。如何在itemscontrol中创建标题模板?因此,由于网格位置,我的控件将正确放置..?如果每列有一个标题,则可以将此标题信息添加到itemssource中,并将标题绑定到datatemplate中。添加此标题信息是什么意思?你能给我举个例子吗?我指的是标题的名称,例如ListBlok2B[0]。HeaderName=“Header1”,ListBlok2B[1]。HeaderName=“Header2”。。。