Framework-Class-Library-Extension icon indicating copy to clipboard operation
Framework-Class-Library-Extension copied to clipboard

Command binding does not work with ElementName and Path attributes.

Open dominkomin opened this issue 10 years ago • 0 comments
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>

dominkomin avatar Sep 04 '15 18:09 dominkomin