Wpf &引用;财产';路径';没有值“0”;

Wpf &引用;财产';路径';没有值“0”;,wpf,data-binding,datacontext,Wpf,Data Binding,Datacontext,我使用以下xaml填充dataContext: DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" 该应用程序运行良好,但Cider抱怨我必须设置Path属性。 我感兴趣的是整个对象,而不是特定的属性 我希望有办法重新获得设计师的支持 在这里查看第2.3.8.7节(您需要向下滚动一点): 尝试将标签更改为 DataContext="{Binding RelativeSource={RelativeSo

我使用以下xaml填充dataContext:

DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
该应用程序运行良好,但Cider抱怨我必须设置Path属性。 我感兴趣的是整个对象,而不是特定的属性


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

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

尝试将标签更改为

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

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

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

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