Imports System.Collections.ObjectModel Imports System.IO Imports EgtUILib Imports EgtWPFLib5 Public Class ModifStartEndWjWindowVM Inherits VMBase Private m_Title As String = String.Empty Public Property Title As String Get Return m_Title End Get Set(value As String) m_Title = value End Set End Property Public ReadOnly Property ValueMsg As String Get Return EgtMsg(MSG_SPLITPAGEUC + 35) End Get End Property Public ReadOnly Property HoleMsg As String Get Return EgtMsg(90875) End Get End Property Public ReadOnly Property LeadInMsg As String Get Return EgtMsg(90769) End Get End Property Public ReadOnly Property LeadOutMsg As String Get Return EgtMsg(90771) End Get End Property Public ReadOnly Property TangDistMsg As String Get Return EgtMsg(90890) End Get End Property Public ReadOnly Property PerpDistMsg As String Get Return EgtMsg(90891) End Get End Property Public ReadOnly Property OkMsg As String Get Return EgtMsg(91651) 'Ok End Get End Property Public ReadOnly Property ExitMsg As String Get Return EgtMsg(91652) 'Annulla End Get End Property Private m_sValue As String Public Property sValue As String Get Return m_sValue End Get Set(value As String) m_sValue = value End Set End Property Private m_bHole As Boolean = False Public Property bHole As Boolean Get Return m_bHole End Get Set(value As Boolean) If value <> m_bHole Then m_bHole = value End If End Set End Property Private m_sLiTangDist As String Public Property sLiTangDist As String Get Return m_sLiTangDist End Get Set(value As String) m_sLiTangDist = value End Set End Property Private m_sLiPerpDist As String Public Property sLiPerpDist As String Get Return m_sLiPerpDist End Get Set(value As String) m_sLiPerpDist = value End Set End Property Private m_sLoTangDist As String Public Property sLoTangDist As String Get Return m_sLoTangDist End Get Set(value As String) m_sLoTangDist = value End Set End Property Private m_sLoPerpDist As String Public Property sLoPerpDist As String Get Return m_sLoPerpDist End Get Set(value As String) m_sLoPerpDist = value End Set End Property Private m_LeadInTypeList As New ObservableCollection(Of IdNameStruct) Public ReadOnly Property LeadInTypeList As ObservableCollection(Of IdNameStruct) Get m_LeadInTypeList = New ObservableCollection(Of IdNameStruct)( {New IdNameStruct(MCH_WATERJET_LI.NONE, EgtMsg(31329)), New IdNameStruct(MCH_WATERJET_LI.LINEAR, EgtMsg(31330)), New IdNameStruct(MCH_WATERJET_LI.TANGENT, EgtMsg(31331))}) Return m_LeadInTypeList End Get End Property Private m_SelectedLeadInType As Integer Public Property SelectedLeadInType As Integer Get Return m_SelectedLeadInType End Get Set(value As Integer) If value <> m_SelectedLeadInType Then m_SelectedLeadInType = value End If End Set End Property Private m_LeadOutTypeList As New ObservableCollection(Of IdNameStruct) Public ReadOnly Property LeadOutTypeList As ObservableCollection(Of IdNameStruct) Get m_LeadOutTypeList = New ObservableCollection(Of IdNameStruct)( {New IdNameStruct(MCH_WATERJET_LO.NONE, EgtMsg(31329)), New IdNameStruct(MCH_WATERJET_LO.LINEAR, EgtMsg(31330)), New IdNameStruct(MCH_WATERJET_LO.TANGENT, EgtMsg(31331)), New IdNameStruct(MCH_WATERJET_LO.AS_LI, EgtMsg(31337))}) Return m_LeadOutTypeList End Get End Property Private m_SelectedLeadOutType As Integer Public Property SelectedLeadOutType As Integer Get Return m_SelectedLeadOutType End Get Set(value As Integer) If value <> m_SelectedLeadOutType Then m_SelectedLeadOutType = value End If End Set End Property Sub New() End Sub Friend Function SetVal(dVal As Double) As Boolean sValue = DoubleToString(dVal, 3) Return True End Function Friend Function GetVal() As Double Dim dVal As Double = 0 StringToDouble(sValue, dVal) Return dVal End Function 'Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click ' m_sValue = ValueTxBx.Text ' DialogResult = True 'End Sub 'Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click ' m_sValue = "" ' DialogResult = False 'End Sub Friend Function SetHole(dVal As Boolean) As Boolean m_bHole = dVal Return True End Function Friend Function GetHole() As Boolean Dim bVal As Boolean = False bVal = m_bHole Return bVal End Function Friend Function SetLiTangDist(dVal As Double) As Boolean m_sLiTangDist = LenToString(dVal, 3) Return True End Function Friend Function GetLiTangDist() As Double Dim dVal As Double = 0 StringToLen(m_sLiTangDist, dVal) Return dVal End Function Friend Function SetLiPerpDist(dVal As Double) As Boolean m_sLiPerpDist = LenToString(dVal, 3) Return True End Function Friend Function GetLiPerpDist() As Double Dim dVal As Double = 0 StringToLen(m_sLiPerpDist, dVal) Return dVal End Function Friend Function SetLoTangDist(dVal As Double) As Boolean m_sLoTangDist = LenToString(dVal, 3) Return True End Function Friend Function GetLoTangDist() As Double Dim dVal As Double = 0 StringToLen(m_sLoTangDist, dVal) Return dVal End Function Friend Function SetLoPerpDist(dVal As Double) As Boolean m_sLoPerpDist = LenToString(dVal, 3) Return True End Function Friend Function GetLoPerpDist() As Double Dim dVal As Double = 0 StringToLen(m_sLoPerpDist, dVal) Return dVal End Function Friend Function SetLeadInType(nLeadTypeId As Integer) As Boolean m_SelectedLeadInType = IdNameStruct.IndFromId(nLeadTypeId, LeadInTypeList) Return True End Function Friend Function GetLeadInType() As IdNameStruct Dim LeadType As IdNameStruct = Nothing LeadType = LeadInTypeList(m_SelectedLeadInType) Return LeadType End Function Friend Function SetLeadOutType(nLeadTypeId As Integer) As Boolean m_SelectedLeadOutType = IdNameStruct.IndFromId(nLeadTypeId, LeadOutTypeList) Return True End Function Friend Function GetLeadOutType() As IdNameStruct Dim LeadType As IdNameStruct = Nothing LeadType = LeadOutTypeList(m_SelectedLeadOutType) Return LeadType End Function Private m_HoleVisibility As Visibility Public Property HoleVisibility As Visibility Get Return m_HoleVisibility End Get Set(value As Visibility) If value <> m_HoleVisibility Then m_HoleVisibility = value NotifyPropertyChanged("HoleVisibility") End If End Set End Property Private m_LeadInVisibility As Visibility Public Property LeadInVisibility As Visibility Get Return m_LeadInVisibility End Get Set(value As Visibility) If value <> m_LeadInVisibility Then m_LeadInVisibility = value NotifyPropertyChanged("LeadInVisibility") End If End Set End Property Private m_LeadOutVisibility As Visibility Public Property LeadOutVisibility As Visibility Get Return m_LeadOutVisibility End Get Set(value As Visibility) If value <> m_LeadOutVisibility Then m_LeadOutVisibility = value NotifyPropertyChanged("LeadOutVisibility") End If End Set End Property End Class