Imports System.Collections.ObjectModel Imports EgtUILib Imports EgtWPFLib5 Public Class GridBoxesVM Inherits VMBase ' riferimento al magazzino Private m_refWarehouse As WarehouseVM ' indice della colonna del magazzino Private m_Column As ColumnsWarehouse Public ReadOnly Property Column As ColumnsWarehouse Get Return m_Column End Get End Property ' lista dei box presenti nella colonna corrente Private m_BoxList As New ObservableCollection(Of Box) Public Property BoxList As ObservableCollection(Of Box) Get Return m_BoxList End Get Set(value As ObservableCollection(Of Box)) m_BoxList = value End Set End Property Private m_CurrBoxList As New ObservableCollection(Of Box) Public ReadOnly Property CurrBoxList As ObservableCollection(Of Box) Get m_CurrBoxList.Clear() For Each ItemBox In m_BoxList If IsPallet And ItemBox.enConfigBox = ConfigBox.PALLET Then m_CurrBoxList.Add(ItemBox) ElseIf IsRack And ItemBox.enConfigBox = ConfigBox.RACK Then m_CurrBoxList.Add(ItemBox) End If Next Return m_CurrBoxList End Get End Property '--------------------------------------------------------------------- Public ReadOnly Property nRows As Integer Get If m_IsPallet Then Return 2 Else Return 1 End If End Get End Property ' identifica la configurazione della colonna Private m_IsPallet As Boolean = True Public Property IsPallet As Boolean Get Return m_IsPallet End Get Set(value As Boolean) m_IsPallet = value m_IsRack = Not value NotifyPropertyChanged("IsRack") NotifyPropertyChanged("CurrBoxList") NotifyPropertyChanged("nRows") End Set End Property Private m_IsRack As Boolean = False Public Property IsRack As Boolean Get Return m_IsRack End Get Set(value As Boolean) m_IsRack = value m_IsPallet = Not value NotifyPropertyChanged("IsPallet") NotifyPropertyChanged("CurrBoxList") NotifyPropertyChanged("nRows") End Set End Property #Region "CONSTUCTOR" Sub New(enColumnWarehouse As ColumnsWarehouse, CurrWarehouseVM As WarehouseVM, enConfig As ConfigWarehose) m_Column = enColumnWarehouse m_refWarehouse = CurrWarehouseVM If enConfig = ConfigWarehose.PALLET Then IsPallet = True Else IsRack = True End If End Sub #End Region ' CONSTRUCTOR #Region "METHOD" #End Region ' METHOD End Class