我看到 DataGrid 数据绑定语法如下:
ItemsSource="{Binding Path=ListDataColumns, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True, UpdateSourceTrigger=PropertyChanged}"
更完整的代码是:
<DataGrid KeyboardNavigation.ControlTabNavigation="Local" KeyboardNavigation.IsTabStop="False" DataContext="{Binding}"
ItemsSource="{Binding Path=ListDataColumns, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True, UpdateSourceTrigger=PropertyChanged}"
AutoGenerateColumns="False" x:Name="DataGridColumnConfig" VerticalAlignment="Top" AllowDrop="True"
IsSynchronizedWithCurrentItem="True" CanUserSortColumns="False" CanUserDeleteRows="False"
CanUserAddRows="False" GridLinesVisibility="All" SelectedItem="{Binding Path=SelectedItem}" SelectedIndex="{Binding Path=SelectedItemIndex}">
我认为代码绑定到一个名为“ListDataColumns”的属性。
如何从 ItemSource 确定绑定到哪个对象?