So, the requirement is to display a context menu on the row of WPF datagrid, similar to the following:

The "out-of-box" way to do that in WPF, is to create a context menu on the grid level, like the following:

<DataGrid x:Name="Datagrid" ItemsSource="{Binding MyItems}" >
    <DataGrid.ContextMenu>
        <ContextMenu>
            <MenuItem Header="Copy" Command="{Binding RowCopyCommand}" />
        </ContextMenu>
    </DataGrid.ContextMenu>
</DataGrid>

The context menu is bound on the grid level, so when there is a binding, like when we bound to a command, then it is binding on the context of the DataGrid data context.
So in case we want to get the selected data grid row, where the context menu was initialized on, then we need to have the DataGrid property "SelectedItem", so we are going to have the following code:

<DataGrid x:Name="_datagrid" ItemsSource="{Binding MyItems}"  
    SelectedItem="{Binding SelectedRow, Mode=TwoWay}" >
       <DataGrid.ContextMenu>
            <ContextMenu>
                <MenuItem Header="Copy" Command="{Binding RowCopyCommand}" />
            </ContextMenu>
       </DataGrid.ContextMenu>
</DataGrid>

Notice how we bound the SelectedItem to a property in the data context.
But still the command and the code should exist in the view model that is bound to the DataGrid level and not the row level.

IN order to have the ContextMenu associated to the row, we can have the following code:

<DataGrid x:Name="_datagrid" ItemsSource="{Binding MyItems}">
    <DataGrid.Resources>
        <ContextMenu x:Key="RowMenu" 
            DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
               <MenuItem Header="Copy" Command="{Binding RowCopyCommand}" />
        </ContextMenu>
    </DataGrid.Resources>
    <DataGrid.RowStyle>
        <Style TargetType="DataGridRow" >
            <Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
        </Style>
    </DataGrid.RowStyle>
</DataGrid>

The above code use the DataGrid.RowStyle to hookup the context menu to the row.
The interesting thing is the DataContext binding where we use PlacementTarget.