DataGrid 的 数据源 ItemsSource 模式Mode=OneWayToSource 会导致 ObservableCollection类型为null 而出现bug
1.在Datagrid绑定数据源时应该这样写
ItemsSource="{Binding Path=FrameContents}"
而不是
ItemsSource="{Binding Path=FrameContents,Mode=OneWayToSource}"
不然会出现 FrameContents,没有初始化为null的情况。
......
查下OneWayToSource模式的意义
浙公网安备 33010602011771号