129 lines
3.2 KiB
VB.net
129 lines
3.2 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class SceneBuildingVM
|
|
Inherits VMBase
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Private m_ButtonBuildingList As New ObservableCollection(Of ButtonBuildingItem)
|
|
Public Property ButtonBuildingList As ObservableCollection(Of ButtonBuildingItem)
|
|
Get
|
|
Return m_ButtonBuildingList
|
|
End Get
|
|
Set(value As ObservableCollection(Of ButtonBuildingItem))
|
|
m_ButtonBuildingList = value
|
|
NotifyPropertyChanged(NameOf(ButtonBuildingList))
|
|
End Set
|
|
End Property
|
|
|
|
Private m_ViewPanel_IsEnable As Boolean = True
|
|
Public ReadOnly Property ViewPanel_IsEnable As Boolean
|
|
Get
|
|
Return m_ViewPanel_IsEnable
|
|
End Get
|
|
End Property
|
|
Friend Sub SetViewPanel_IsEnable(value As Boolean)
|
|
m_ViewPanel_IsEnable = value
|
|
NotifyPropertyChanged(NameOf(ViewPanel_IsEnable))
|
|
End Sub
|
|
|
|
#End Region ' Fields & Properties
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
Map.SetRefSceneBuildingVM(Me)
|
|
End Sub
|
|
|
|
#End Region ' Constructor
|
|
|
|
End Class
|
|
|
|
Public Class ButtonBuildingItem
|
|
Inherits VMBase
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Private m_nIdProd As Integer
|
|
Public Property nIndProd As Integer
|
|
Get
|
|
Return m_nIdProd
|
|
End Get
|
|
Set(value As Integer)
|
|
m_nIdProd = value
|
|
NotifyPropertyChanged(NameOf(nIndProd))
|
|
End Set
|
|
End Property
|
|
|
|
Private m_nAsseBase As Integer
|
|
Public Property nAsseBase As Integer
|
|
Get
|
|
Return m_nAsseBase
|
|
End Get
|
|
Set(value As Integer)
|
|
m_nAsseBase = value
|
|
NotifyPropertyChanged(NameOf(nAsseBase))
|
|
End Set
|
|
End Property
|
|
|
|
Private m_sNameBTL As String
|
|
Public Property sNameBTL As String
|
|
Get
|
|
Return m_sNameBTL
|
|
End Get
|
|
Set(value As String)
|
|
m_sNameBTL = value
|
|
NotifyPropertyChanged(NameOf(sNameBTL))
|
|
End Set
|
|
End Property
|
|
|
|
' Definizione Comandi
|
|
Private m_ChangeSceneCmd As ICommand
|
|
|
|
#End Region ' Fields & Properties
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New(nIndProd As Integer, nAsseBase As Integer, sNameBTL As String)
|
|
m_nIdProd = nIndProd
|
|
m_nAsseBase = nAsseBase
|
|
m_sNameBTL = sNameBTL
|
|
End Sub
|
|
|
|
#End Region ' Constructor
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "ChangeSceneCommand"
|
|
|
|
Public ReadOnly Property ChangeSceneCommand As ICommand
|
|
Get
|
|
If m_ChangeSceneCmd Is Nothing Then
|
|
m_ChangeSceneCmd = New Command(AddressOf ChangeScene)
|
|
End If
|
|
Return m_ChangeSceneCmd
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub ChangeScene(ByVal param As Object)
|
|
' Setto il nuovo contesto
|
|
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
|
|
For Each ItemAsseBaseId As Integer In Map.refProdManagerVM.ListProjAsseBase.Values
|
|
If ItemAsseBaseId = m_nAsseBase Then
|
|
EgtSetStatus(ItemAsseBaseId, GDB_ST.ON_)
|
|
Else
|
|
EgtSetStatus(ItemAsseBaseId, GDB_ST.OFF)
|
|
End If
|
|
Next
|
|
EgtRedraw()
|
|
' Ritorno al contesto corrente
|
|
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
|
|
End Sub
|
|
|
|
#End Region ' ChangeSceneCommand
|
|
|
|
#End Region ' Commands
|
|
|
|
End Class |