Files
EgtDOORCreator/StatusBar/StatusBarViewModel.vb
T
Nicola Pievani 1158fa4d9f EgtDOORCreator 1.8d1 :
- modifiche e migliorie varie.
2017-04-21 15:47:51 +00:00

153 lines
4.4 KiB
VB.net

Imports System.Collections.ObjectModel
Imports System.Runtime.InteropServices
Imports System.IO
Imports EgtUILib
Imports System.Threading
Imports System.ComponentModel
Public Class StatusBarViewModel
Implements INotifyPropertyChanged
Private m_rfSceneManagerViewModel As SceneManagerViewModel
#Region "FIELDS & PROPERTIES"
' Funzioni di callback per output in interfaccia da LUA
'Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
'Private m_OutTextCallback As New OutTextCallback(AddressOf OutText)
' GRAPHICAL ELEMENTS
Private m_StatusOutput As String
Public Property StatusOutput As String
Get
Return m_StatusOutput
End Get
Set(value As String)
m_StatusOutput = value
NotifyPropertyChanged("StatusOutput")
End Set
End Property
''Private m_MsgError As String
''Public Property MsgError As String
'' Get
'' Return m_MsgError
'' End Get
'' Set(value As String)
'' m_MsgError = value
'' NotifyPropertyChanged("MsgError")
'' End Set
''End Property
''Private m_ButtonVisibility As Visibility = Visibility.Collapsed
''Public Property ButtonVisibility As Visibility
'' Get
'' Return m_ButtonVisibility
'' End Get
'' Set(value As Visibility)
'' m_ButtonVisibility = value
'' NotifyPropertyChanged("ButtonVisibility")
'' End Set
''End Property
Private m_UnitMeasure As String = OptionModule.m_SelectedMeasureUnit
Public Property UnitMeasure As String
Get
Return m_UnitMeasure
End Get
Set(value As String)
If value = Trim("Inches") Then value = "in"
m_UnitMeasure = value
NotifyPropertyChanged("UnitMeasure")
End Set
End Property
Private m_SnapPointTypeList As New List(Of SPItem)({New SPItem(SP.PT_END, EgtMsg(1105)), New SPItem(SP.PT_MID, EgtMsg(1107)), New SPItem(SP.CENTER, EgtMsg(1109)), New SPItem(SP.PT_INTERS, EgtMsg(1115)), New SPItem(SP.CENTROID, EgtMsg(1111))})
Public ReadOnly Property SnapPointTypeList As List(Of SPItem)
Get
Return m_SnapPointTypeList
End Get
End Property
Private m_SnapPointSelect As SPItem = m_SnapPointTypeList(0)
Public Property SnapPointSelect As SPItem
Get
ActivateSnapPointSelected(m_SnapPointSelect)
Return m_SnapPointSelect
End Get
Set(value As SPItem)
m_SnapPointSelect = value
NotifyPropertyChanged("SnapPointSelect")
End Set
End Property
#End Region ' Fields & Properties
'' Definizione comandi
'Private m_CmdShowErrorBtn As ICommand
' applica la selezione del punto notevole
Public Sub ActivateSnapPointSelected(SnapPoint As SPItem)
m_rfSceneManagerViewModel.ProjectScene.SetSnapPointType(SnapPoint.SPValue)
End Sub
#Region "CONSTRUCTOR"
Sub New(ByRef SceneManagerViewModel As SceneManagerViewModel)
m_rfSceneManagerViewModel = SceneManagerViewModel
End Sub
#End Region ' Constructor
#Region "COMMAND"
#Region "ShowErrorCommand"
'' carico il valore del messaggio di errore
'Friend m_MsgGraphic As String
'Public ReadOnly Property ShowErrorBtnCommand As ICommand
' Get
' If m_CmdShowErrorBtn Is Nothing Then
' m_CmdShowErrorBtn = New Command(AddressOf ShowErrorBtn)
' End If
' Return m_CmdShowErrorBtn
' End Get
'End Property
'Public Sub ShowErrorBtn()
' MessageBox.Show(m_MsgGraphic, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'End Sub
#End Region ' ShowErrorCommand
#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 SPItem
Private m_SPValue As SP
Public ReadOnly Property SPValue As SP
Get
Return m_SPValue
End Get
End Property
Private m_SPMessage As String
Public ReadOnly Property SPMessage As String
Get
Return m_SPMessage
End Get
End Property
Sub New(Value As SP, Message As String)
m_SPValue = Value
m_SPMessage = Message
End Sub
End Class