Files
EgtCAM5/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
T
Emmanuele Sassi d24641a0b2 EgtCAM5 :
- Migliorie varie.
2016-07-08 13:19:54 +00:00

120 lines
3.5 KiB
VB.net

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"
''' <summary>
''' Returns a command that do Point.
''' </summary>
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
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub NewPart(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.NEWPART)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanNewPart(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' NewPartCommand
#Region "NewLayerCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
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
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub NewLayer(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.NEWLAYER)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanNewLayer(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' NewLayerCommand
#Region "LayerColorCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
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
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub LayerColor(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.LAYERCOLOR)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanLayerColor(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' NewLayerCommand
End Class
End Namespace