Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtstone3d into develop
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class SceneUserControlVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
@@ -66,6 +67,29 @@ Public Class SceneUserControlVM
|
||||
Public Overridable Sub LoadParamList()
|
||||
End Sub
|
||||
|
||||
Public Sub AddGenericParam(Control As GenericParam)
|
||||
If TypeOf Control Is _CheckBoxParam Then
|
||||
AddHandler DirectCast(Control, _CheckBoxParam).CheckChanged, AddressOf OnCheckboxCheckedChanged
|
||||
End If
|
||||
If TypeOf Control Is _ComboBoxParam Then
|
||||
AddHandler DirectCast(Control, _ComboBoxParam).SelectionChanged, AddressOf OnComboboxSelectionChanged
|
||||
End If
|
||||
If TypeOf Control Is _TextBoxParam Then
|
||||
AddHandler DirectCast(Control, _TextBoxParam).TextChanged, AddressOf OnTextboxTextChanged
|
||||
End If
|
||||
ParamList.Add(Control)
|
||||
End Sub
|
||||
|
||||
' Event handler for checkbox CheckedChanged
|
||||
Public Overridable Sub OnCheckboxCheckedChanged(sender As Object, CheckState As Boolean)
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub OnComboboxSelectionChanged(sender As Object, Selection As ParamCmBx)
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub OnTextboxTextChanged(sender As Object, Text As String)
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -138,12 +162,36 @@ Public Class GenericParam
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nVisibility As Visibility = Visibility.Visible
|
||||
Public Property nVisibility As Visibility
|
||||
Get
|
||||
Return m_nVisibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_nVisibility = value
|
||||
NotifyPropertyChanged(NameOf(nVisibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsEnabled As Boolean = True
|
||||
Public Property IsEnabled As Boolean
|
||||
Get
|
||||
Return m_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsEnabled = value
|
||||
NotifyPropertyChanged(NameOf(IsEnabled))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(sName As String)
|
||||
Sub New(sName As String, Optional Visibility As Visibility = Visibility.Visible, Optional bIsEnabled As Boolean = True)
|
||||
m_Name = sName
|
||||
nVisibility = Visibility
|
||||
IsEnabled = bIsEnabled
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -153,16 +201,18 @@ End Class
|
||||
Public Class _TextBoxParam
|
||||
Inherits GenericParam
|
||||
|
||||
Public Event TextChanged(sender As Object, text As String)
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_Value As String = String.Empty
|
||||
Public Property Value As String
|
||||
Private m_sValue As String = String.Empty
|
||||
Public Property sValue As String
|
||||
Get
|
||||
Return m_Value
|
||||
Return m_sValue
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Value = value
|
||||
NotifyPropertyChanged(NameOf(value))
|
||||
m_sValue = value
|
||||
RaiseEvent TextChanged(Me, m_sValue)
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -170,9 +220,9 @@ Public Class _TextBoxParam
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(sName As String, sValue As String)
|
||||
MyBase.New(sName)
|
||||
m_Value = sValue
|
||||
Sub New(sName As String, sValue As String, Optional nVisibility As Visibility = Visibility.Visible, Optional bIsEnabled As Boolean = True)
|
||||
MyBase.New(sName, nVisibility, bIsEnabled)
|
||||
m_sValue = sValue
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -191,7 +241,7 @@ Public Class _TextBlockParam
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_MsgValue = value
|
||||
NotifyPropertyChanged(NameOf(value))
|
||||
NotifyPropertyChanged(NameOf(MsgValue))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -199,8 +249,8 @@ Public Class _TextBlockParam
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(sName As String, sValue As String)
|
||||
MyBase.New(sName)
|
||||
Sub New(sName As String, sValue As String, Optional nVisibility As Visibility = Visibility.Visible, Optional bIsEnabled As Boolean = True)
|
||||
MyBase.New(sName, nVisibility, bIsEnabled)
|
||||
m_MsgValue = sValue
|
||||
End Sub
|
||||
|
||||
@@ -211,6 +261,7 @@ End Class
|
||||
Public Class _ComboBoxParam
|
||||
Inherits GenericParam
|
||||
|
||||
Public Event SelectionChanged(sender As Object, selection As ParamCmBx)
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_ParamCmBxList As New List(Of ParamCmBx)
|
||||
@@ -231,6 +282,7 @@ Public Class _ComboBoxParam
|
||||
End Get
|
||||
Set(value As ParamCmBx)
|
||||
m_SelParamCmBx = value
|
||||
RaiseEvent SelectionChanged(Me, m_SelParamCmBx)
|
||||
NotifyPropertyChanged(NameOf(SelParamCmBx))
|
||||
End Set
|
||||
End Property
|
||||
@@ -239,10 +291,11 @@ Public Class _ComboBoxParam
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(sName As String, _ParamCmBxList As List(Of ParamCmBx))
|
||||
MyBase.New(sName)
|
||||
Sub New(sName As String, _ParamCmBxList As List(Of ParamCmBx), IndexSelected As Integer,
|
||||
Optional nVisibility As Visibility = Visibility.Visible, Optional bIsEnabled As Boolean = True)
|
||||
MyBase.New(sName, nVisibility, bIsEnabled)
|
||||
m_ParamCmBxList = _ParamCmBxList
|
||||
m_SelParamCmBx = m_ParamCmBxList(0)
|
||||
m_SelParamCmBx = m_ParamCmBxList(IndexSelected)
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -273,4 +326,46 @@ Public Class ParamCmBx
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
End Class
|
||||
|
||||
Public Class _CheckBoxParam
|
||||
Inherits GenericParam
|
||||
|
||||
Public Event CheckChanged(sender As Object, checked As Boolean)
|
||||
#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
|
||||
|
||||
Private m_IsChecked As Boolean = False
|
||||
Public Property IsChecked As Boolean
|
||||
Get
|
||||
Return m_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsChecked = value
|
||||
RaiseEvent CheckChanged(Me, m_IsChecked)
|
||||
NotifyPropertyChanged(NameOf(value))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(sName As String, sValue As String, Optional nVisibility As Visibility = Visibility.Visible, Optional bIsEnabled As Boolean = True)
|
||||
MyBase.New(sName, nVisibility, bIsEnabled)
|
||||
m_MsgValue = sValue
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user