aa367c4345
- Passaggio a lettura intestazione file DDF per avere i parametri dei componenti.
114 lines
3.3 KiB
VB.net
114 lines
3.3 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib
|
|
'Imports System.Text.RegularExpressions
|
|
|
|
Public Class DoorParametersViewModel
|
|
Implements INotifyPropertyChanged
|
|
|
|
Private m_rfMainWindowViewModel As MainWindowViewModel
|
|
|
|
Private m_CurrDoor As Door
|
|
Public Property CurrDoor As Door
|
|
Get
|
|
Return m_CurrDoor
|
|
End Get
|
|
Set(value As Door)
|
|
m_CurrDoor = value
|
|
NotifyPropertyChanged("CurrDoor")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_CurrProject As Project
|
|
Public ReadOnly Property CurrProject As Project
|
|
Get
|
|
Return m_CurrProject
|
|
End Get
|
|
End Property
|
|
|
|
Sub New(ByRef MainWindowViewModel As MainWindowViewModel)
|
|
m_rfMainWindowViewModel = MainWindowViewModel
|
|
Dim DoorManagerViewModel As DoorManagerViewModel = DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel)
|
|
Dim CurrProject As Project = DoorManagerViewModel.CurrProject
|
|
' salvo il riferimento al progetto corrente
|
|
m_CurrProject = CurrProject
|
|
End Sub
|
|
|
|
#Region "Messages"
|
|
|
|
'General'
|
|
Public ReadOnly Property WidthMsg As String
|
|
Get
|
|
Return EgtMsg(50001)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property HeightMsg As String
|
|
Get
|
|
Return EgtMsg(50002)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property ThicknessMsg As String
|
|
Get
|
|
Return EgtMsg(50003)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property SwingMsg As String
|
|
Get
|
|
Return EgtMsg(50004)
|
|
End Get
|
|
End Property
|
|
|
|
'Profiles'
|
|
Public ReadOnly Property LockedgeMsg As String
|
|
Get
|
|
Return EgtMsg(50005)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property HingeedgeMsg As String
|
|
Get
|
|
Return EgtMsg(50006)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property TopMsg As String
|
|
Get
|
|
Return EgtMsg(50007)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property BottomMsg As String
|
|
Get
|
|
Return EgtMsg(50008)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property ApplyBtnMsg As String
|
|
Get
|
|
Return "Apply"
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property DeleteBtnMsg As String
|
|
Get
|
|
Return "Delete"
|
|
End Get
|
|
End Property
|
|
#End Region
|
|
|
|
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
|
|
|
Public Sub NotifyPropertyChanged(propName As String)
|
|
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Public Class DoorVisibilityConverter
|
|
Implements IValueConverter
|
|
|
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
|
Dim DoorList As ObservableCollection(Of String) = DirectCast(value, ObservableCollection(Of String))
|
|
Return If(DoorList.Count = 0, Visibility.Collapsed, Visibility.Visible)
|
|
End Function
|
|
|
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
|
Throw New NotImplementedException
|
|
End Function
|
|
|
|
End Class |