I am implementing MVVM pattern for my application. I have my Views, ViewModel, Model and Commands and Converters being implemented. Now I am not able to pass my textboxes values from my datatemplate to my ViewModel through the command binding. I am able to click on the button to attempt the update process but its not able to pass the textboxes value. Are there something i need to change on my command class?

Here is my XAML:

```
<DataGrid AutoGenerateColumns="False" Grid.Row="2" Grid.ColumnSpan="4" Grid.RowSpan="3" x:Name="productionLineConfigDataGrid" Margin="70,0.2,70,0" ItemsSource="{Binding listAllProductionLineConfigs}">
<DataTemplate>
<StackPanel>
        <StackPanel Orientation="Horizontal">
                <TextBlock FontSize="12" Text="ID: " VerticalAlignment="Center" />
                <TextBlock x:Name="txtBlockLineId" FontSize="16" Foreground="MidnightBlue" Text="{Binding ProductionLineId, Mode=TwoWay}" VerticalAlignment="Center" />
        </StackPanel>
        <StackPanel>
                <Button x:Name="btnUpdate" Content="Update" VerticalAlignment="Center" HorizontalAlignment="Right" Click="btnUpdate_Click" Command="{Binding DataContext.updateProductionLineConfigCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:production_line_config_home}}}" CommandParameter="{Binding ProductionLineConfig}"/>
        </StackPanel>
</StackPanel>
</DataTemplate>
</DataGrid>

```

Here is the method from my ViewModel:

```
public ProductionLineConfig ProductionLineConfig
    {
        get { return productionlineconfig; }

        set
        {
            productionlineconfig = value;
            OnPropertyChanged("ProductionLineConfig");
        }
    }

```

This is the error message i am getting:

> 
> System.Windows.Data Error: 40 : BindingExpression path error: 'ProductionLineConfig' property not found on 'object' ''ProductionLineConfig' (HashCode=47309994)'. BindingExpression:Path=ProductionLineConfig; DataItem='ProductionLineConfig' (HashCode=47309994); target element is 'Button' (Name=''); target property is 'CommandParameter' (type 'Object')
> 
> 
> 

I have included the image for my application [here](https://i.stack.imgur.com/wzKYy.png)

This is the entire xaml code [here](https://pastebin.com/2AuEatSU) and this is the entire viewmodel code [here](https://pastebin.com/0kDCpb8p)