Files
egtstone3d/SceneUserControl/SceneUserControlVM.vb
T
2025-01-13 15:42:39 +01:00

276 lines
5.3 KiB
VB.net

Imports EgtWPFLib5
Imports EgtUILib
Public Class SceneUserControlVM
#Region "FIELDS & PROPERTIES"
Private m_Title As String
Public Property Title As String
Get
Return m_Title
End Get
Set(value As String)
m_Title = value
End Set
End Property
Private m_ParamList As New List(Of GenericParam)
Public Property ParamList As List(Of GenericParam)
Get
Return m_ParamList
End Get
Set(value As List(Of GenericParam))
m_ParamList = value
End Set
End Property
#Region "Messages"
Public ReadOnly Property Conferma_Msg As String
Get
Return EgtMsg(110003)
End Get
End Property
Public ReadOnly Property Preview_Msg As String
Get
Return EgtMsg(110017)
End Get
End Property
Public ReadOnly Property Annulla_Msg As String
Get
Return EgtMsg(110004)
End Get
End Property
#End Region ' Messages
' Definisco i comandi
Private m_ConfermaCmd As ICommand
Private m_PreviewCmd As ICommand
Private m_AnnullaCmd As ICommand
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
End Sub
#End Region ' Constructor
#Region "METHODS"
Public Overridable Sub LoadParamList()
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "ConfermCmd"
Public ReadOnly Property ConfermaCmd As ICommand
Get
If m_ConfermaCmd Is Nothing Then
m_ConfermaCmd = New Command(AddressOf Conferma)
End If
Return m_ConfermaCmd
End Get
End Property
Public Overridable Sub Conferma()
End Sub
#End Region ' ConfermaCmd
#Region "PreviewCmd"
Public ReadOnly Property PreviewCmd As ICommand
Get
If m_PreviewCmd Is Nothing Then
m_PreviewCmd = New Command(AddressOf ShowPreview)
End If
Return m_PreviewCmd
End Get
End Property
Public Overridable Sub ShowPreview()
End Sub
#End Region ' PreviewCmd
#Region "AnnullaCmd"
Public ReadOnly Property AnnullaCmd As ICommand
Get
If m_AnnullaCmd Is Nothing Then
m_AnnullaCmd = New Command(AddressOf Annulla)
End If
Return m_AnnullaCmd
End Get
End Property
Public Overridable Sub Annulla()
End Sub
#End Region ' AnnullaCmd
#End Region ' Commands
End Class
Public Class GenericParam
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_Name As String = String.Empty
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
NotifyPropertyChanged(NameOf(Name))
End Set
End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(sName As String)
m_Name = sName
End Sub
#End Region ' Constructor
End Class
Public Class _TextBoxParam
Inherits GenericParam
#Region "FIELDS & PROPERTIES"
Private m_Value As String = String.Empty
Public Property Value As String
Get
Return m_Value
End Get
Set(value As String)
m_Value = value
NotifyPropertyChanged(NameOf(value))
End Set
End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(sName As String, sValue As String)
MyBase.New(sName)
m_Value = sValue
End Sub
#End Region ' Constructor
End Class
Public Class _TextBlockParam
Inherits GenericParam
#Region "FIELDS & PROPERTIES"
Private m_MsgValue As String = String.Empty
Public Property MsgValue As String
Get
Return m_MsgValue
End Get
Set(value As String)
m_MsgValue = value
NotifyPropertyChanged(NameOf(value))
End Set
End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(sName As String, sValue As String)
MyBase.New(sName)
m_MsgValue = sValue
End Sub
#End Region ' Constructor
End Class
Public Class _ComboBoxParam
Inherits GenericParam
#Region "FIELDS & PROPERTIES"
Private m_ParamCmBxList As New List(Of ParamCmBx)
Public Property ParamCmBxList As List(Of ParamCmBx)
Get
Return m_ParamCmBxList
End Get
Set(value As List(Of ParamCmBx))
m_ParamCmBxList = value
NotifyPropertyChanged(NameOf(ParamCmBxList))
End Set
End Property
Private m_SelParamCmBx As ParamCmBx
Public Property SelParamCmBx As ParamCmBx
Get
Return m_SelParamCmBx
End Get
Set(value As ParamCmBx)
m_SelParamCmBx = value
NotifyPropertyChanged(NameOf(SelParamCmBx))
End Set
End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(sName As String, _ParamCmBxList As List(Of ParamCmBx))
MyBase.New(sName)
m_ParamCmBxList = _ParamCmBxList
m_SelParamCmBx = m_ParamCmBxList(0)
End Sub
#End Region ' Constructor
End Class
Public Class ParamCmBx
#Region "FIELDS & PROPERTIES"
Private m_Name As String = String.Empty
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
End Set
End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(sName As String)
m_Name = sName
End Sub
#End Region ' Constructor
End Class