Framework-Class-Library-Extension
Framework-Class-Library-Extension copied to clipboard
Command binding does not work with ElementName and Path attributes.
trafficstars
When a current data context has to be escaped by usage of the ElementName and Path attributes, following exception is thrown during compilation:
"Invalid path "DataContext.BaseActivity" for object of type "Laevo.ViewModel.Activity.WorkIntervalViewModel".\r\nParameter name: path"
Code example in WorkIntervalControl:
<DataTemplate DataType="userVm:UserViewModel">
<user:UserImage
behaviors:MouseBehavior.LeftClickCommand="{wtc:CommandBinding {x:Static b:Commands.OpenTimeLineSharing}, ElementName=Control, Path=DataContext.BaseActivity}" />
</DataTemplate>