Imports System.Collections.ObjectModel Imports EgtUILib Namespace EgtCAM5 Public Class ManageLayerExpanderViewModel #Region "Fields & Properties" ' Definizione comandi Private m_cmdNewPart As ICommand Private m_cmdNewLayer As ICommand Private m_cmdLayerColor As ICommand ' Lista dei layer Private m_LayerList As New ObservableCollection(Of LayerTreeViewItem) Public Property LayerList As ObservableCollection(Of LayerTreeViewItem) Get Return m_LayerList End Get Set(value As ObservableCollection(Of LayerTreeViewItem)) m_LayerList = value End Set End Property #End Region #Region "NewPartCommand" ''' ''' Returns a command that do Point. ''' Public ReadOnly Property NewPartCommand As ICommand Get If m_cmdNewPart Is Nothing Then m_cmdNewPart = New RelayCommand(AddressOf NewPart, AddressOf CanNewPart) End If Return m_cmdNewPart End Get End Property ''' ''' Execute the Point. This method is invoked by the PointCommand. ''' Public Sub NewPart(ByVal param As Object) Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.NEWPART) End Sub ''' ''' Returns always true. ''' Private Function CanNewPart(ByVal param As Object) As Boolean Return True End Function #End Region ' NewPartCommand #Region "NewLayerCommand" ''' ''' Returns a command that do Point. ''' Public ReadOnly Property NewLayerCommand As ICommand Get If m_cmdNewLayer Is Nothing Then m_cmdNewLayer = New RelayCommand(AddressOf NewLayer, AddressOf CanNewLayer) End If Return m_cmdNewLayer End Get End Property ''' ''' Execute the Point. This method is invoked by the PointCommand. ''' Public Sub NewLayer(ByVal param As Object) Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.NEWLAYER) End Sub ''' ''' Returns always true. ''' Private Function CanNewLayer(ByVal param As Object) As Boolean Return True End Function #End Region ' NewLayerCommand #Region "LayerColorCommand" ''' ''' Returns a command that do Point. ''' Public ReadOnly Property LayerColorCommand As ICommand Get If m_cmdLayerColor Is Nothing Then m_cmdLayerColor = New RelayCommand(AddressOf LayerColor, AddressOf CanLayerColor) End If Return m_cmdLayerColor End Get End Property ''' ''' Execute the Point. This method is invoked by the PointCommand. ''' Public Sub LayerColor(ByVal param As Object) Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.LAYERCOLOR) End Sub ''' ''' Returns always true. ''' Private Function CanLayerColor(ByVal param As Object) As Boolean Return True End Function #End Region ' NewLayerCommand End Class End Namespace