Imports System.Collections.ObjectModel Imports EgtUILib Namespace EgtCAM5 Public Class MachGroupPanelViewModel Inherits ViewModelBase Private m_MachGroupList As New ObservableCollection(Of String) Public Property MachGroupList As ObservableCollection(Of String) Get Return m_MachGroupList End Get Set(value As ObservableCollection(Of String)) If value IsNot m_MachGroupList Then m_MachGroupList = value End If End Set End Property Private Sub LoadMachGroups() ' Carico i gruppi di lavorazione nella lista Dim nId = EgtGetFirstMachGroup() While nId <> GDB_ID.NULL Dim sName As String = String.Empty EgtGetMachGroupName(nId, sName) MachGroupList.Add(sName) nId = EgtGetNextMachGroup(nId) End While End Sub Sub New() Application.Msn.Register(Application.LOADMACHGROUP, Sub() LoadMachGroups() End Sub) End Sub End Class End Namespace