为什么与 DataGridTemplateColumn
的 DataTemplate
上的 ElementName
绑定(bind)不起作用(将始终回退到默认值或 FallbackValue
) 在 Windows XP 和 .Net 4.0 下?
<DataGridTemplateColumn Header="AAA" Width="62">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox IsEnabled="{Binding ElementName=ComboBox, Path=IsEnabled}">
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
但 Windows 7 及更高版本此绑定(bind)按预期工作。
让它在 Windows XP 下工作的唯一方法是使用 x:Reference .
最佳答案
WPF 不支持 Windows XP。
您可以通过以下来源告诉您的老板:Windows Presentation Foundation .它来自 Microsoft,这是官方的。
关于c# - 与 ElementName 的绑定(bind)不适用于 Windows XP 上的 DataTemplate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40486560/