【问题标题】:"Property 'Path' does not have a value"“属性‘路径’没有值”
【发布时间】:2009-01-22 16:20:22
【问题描述】:

我正在使用以下 xaml 来填充 dataContext:

DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"

应用程序运行良好,但 Cider 抱怨我必须设置 Path 属性。 我对整个对象感兴趣,而不是对特定属性感兴趣。

我希望有办法让设计师重新获得支持!

【问题讨论】:

    标签: wpf data-binding datacontext


    【解决方案1】:

    在这里查看第 2.3.8.7 节(您需要向下滚动一点):

    Visual Studio 2008 Service Pack 1 (SP1) Readme

    尝试将您的标签更改为

    DataContext="{Binding RelativeSource={RelativeSource TemplatedParent},Path=.}"
    

    【讨论】:

      【解决方案2】:

      谢谢,这正是我让我的 RD 工作所需要的,修复来自:

      CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
      

      到:

      CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent},Path=.}"
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-09-07
        • 2020-10-08
        • 1970-01-01
        • 2018-04-19
        • 1970-01-01
        • 2017-07-31
        相关资源
        最近更新 更多