c# - 与 ElementName 的绑定(bind)不适用于 Windows XP 上的 DataTemplate

标签 c# wpf binding .net-4.0

为什么与 DataGridTemplateColumnDataTemplate 上的 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/

相关文章:

c# - 将 ExpandoObject 转换为匿名类型

c# - 错误 : The model item passed into the dictionary is null, 但此字典需要类型为 'System.DateTime' 的非空模型项

wpf - WPF 4 的表达式混合发布日期

c# - WPF MVVM 绑定(bind)嵌套属性

C# wpf,从文本框绑定(bind)到 dataGridColumn

android - 绑定(bind)到android中的同一个服务实例

c# - C# 中的集合

WPF 绑定(bind)到一个不变的属性

c# - 当 showdialogwindow 阻止我尝试访问的窗口时,是否有事件或我可以使用的东西

c# - 无法使用 GET 访问 API 端点