Imports EgtBEAMWALL.Core

Class QParameterListV

   Private Sub QParameterList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
      If TypeOf sender Is DataGridRow Then
         Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
         If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then
            Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam
         End If
      End If
   End Sub

   ' funzione che impedisce di editare le righe che sono gia' in produzione
   Private Sub QParameterList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs)
      If IsNothing(e.Row) Then Return
      If Map.refMainMenuVM.SelPage <> Pages.MACHINING Then Return
      Dim RowVM As BTLParamVM = DirectCast(e.Row.DataContext, BTLParamVM)
      ' se in produzione impedisco modifica dei parametri
      If DirectCast(RowVM.BTLParamM.ParentFeature.ParentPart, PartM).nProductionState > ItemState.ND Then
         'For Each cell In Row.Item
         e.Cancel = True
      End If
   End Sub

End Class
