我正在使用以下 xaml 来填充 dataContext:
DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
该应用程序运行良好,但 Cider 抱怨我必须设置 Path 属性。我对整个对象感兴趣,而不是对特定属性感兴趣。
我希望有办法让设计师支持回来!
我正在使用以下 xaml 来填充 dataContext:
DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
该应用程序运行良好,但 Cider 抱怨我必须设置 Path 属性。我对整个对象感兴趣,而不是对特定属性感兴趣。
我希望有办法让设计师支持回来!
在此处查看第 2.3.8.7 节(您需要向下滚动一点):
Visual Studio 2008 Service Pack 1 (SP1) 自述文件
尝试将您的标签更改为
DataContext="{Binding RelativeSource={RelativeSource TemplatedParent},Path=.}"
谢谢,这正是我需要让我的 RD 工作,修复来自:
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
到:
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent},Path=.}"