Files
EgtDOORCreator/DoorParameters/DoorParametersViewModel.vb
T
Nicola Pievani efb250b4a4 EgtDOORCreator 1.8e2 :
- aggiunto il campo "Weight" al general del door,
- aggiunta di una variabile booleana alla funzione ReadDDF nella classe Door per permettere di stampare le funzioni scritte nelle textbox, attualmente no è in uso (settata True)
2017-05-09 16:04:50 +00:00

170 lines
4.7 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
Friend bSetChange As Boolean = False
Private m_CurrDoor As Door
Public Property CurrDoor As Door
Get
Return m_CurrDoor
End Get
Set(value As Door)
m_CurrDoor = value
If Not IsNothing(m_CurrDoor) Then
m_CurrDoor.SetVarSize()
End If
NotifyPropertyChanged("CurrDoor")
End Set
End Property
Private m_CurrProject As Project
Public Property CurrProject As Project
Get
Return m_CurrProject
End Get
Set(value As Project)
m_CurrProject = value
End Set
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
Door.m_rfModifyTitle = AddressOf m_rfMainWindowViewModel.ModifyTitle
End Sub
#Region "Messages"
'General'
Public ReadOnly Property EdgeMsg As String
Get
Return EgtMsg(50044)
End Get
End Property
Public ReadOnly Property OverMaterialMsg As String
Get
Return EgtMsg(50045)
End Get
End Property
Public ReadOnly Property GeneralMsg As String
Get
Return EgtMsg(50040)
End Get
End Property
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 DeleteBtnMsg As String
Get
Return EgtMsg(50126)
End Get
End Property
Public ReadOnly Property WeightMsg As String
Get
Return EgtMsg(50047)
End Get
End Property
#End Region
Public ReadOnly Property DeleteCompoToolTip As String
Get
Return EgtMsg(50142)
End Get
End Property
' definizione comando
Private m_EnterRefreshCmd As ICommand
#Region "COMMANDS"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property RefreshCmd As ICommand
Get
If m_EnterRefreshCmd Is Nothing Then
m_EnterRefreshCmd = New Command(AddressOf EnterRefresh)
End If
Return m_EnterRefreshCmd
End Get
End Property
Public Sub EnterRefresh()
DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).RefreshBtn()
End Sub
#End Region ' Command
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