我可以使用 elementStyle 将 DatagridTextColumn IsReadOnly 绑定到 ViewModel 内的属性(此处为 IsReadOnlyProperty)吗?像这样的东西:
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="IsEnabled" Value="{Binding IsReadOnlyProperty}"/>
</Style>
</DataGridTextColumn.ElementStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="IsEnabled" Value="{Binding IsReadOnlyProperty}" />
</Style>
</DataGridTextColumn.EditingElementStyle>