Imports EgtUILib Namespace EgtCAM5 Public Class ShowPanelViewModel Inherits ViewModelBase #Region "FIELDS & PROPERTIES" ' Definizione comandi Private m_cmdWireframe As ICommand Private m_cmdHiddenLine As ICommand Private m_cmdShading As ICommand Private m_cmdCurveDir As ICommand #Region "ToolTip" Public ReadOnly Property RenderingWFToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 1) End Get End Property Public ReadOnly Property RenderingHLToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 2) End Get End Property Public ReadOnly Property RenderingSHToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 3) End Get End Property Public ReadOnly Property CurveDirToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 16) End Get End Property #End Region Private m_CurveDirIsChecked As Boolean Public Property CurveDirIsChecked As Boolean Get Return m_CurveDirIsChecked End Get Set(value As Boolean) If value <> m_CurveDirIsChecked Then m_CurveDirIsChecked = value EgtSetShowCurveDirection(value) OnPropertyChanged("CurveDirIsChecked") End If End Set End Property #End Region ' FIELDS & PROPERTIES #Region "COMMANDS" #Region "WireframeCommand" ''' ''' Returns a command that manage the MainWindow_ContentRendered command ''' Public ReadOnly Property WireframeCommand() As ICommand Get If m_cmdWireframe Is Nothing Then m_cmdWireframe = New RelayCommand(AddressOf Wireframe) End If Return m_cmdWireframe End Get End Property ''' ''' Manage the MainWindow_ContentRendered event. This method is invoked by the cmdMainWindow_ContentRendered. ''' Public Sub Wireframe(ByVal param As Object) ' Notify the ContentRendered event Application.Msn.NotifyColleagues(Application.WIREFRAME) End Sub #End Region ' WireframeCommand #Region "HiddenLineCommand" ''' ''' Returns a command that swith the view mode to HiddenLine. ''' Public ReadOnly Property HiddenLineCommand As ICommand Get If m_cmdHiddenLine Is Nothing Then m_cmdHiddenLine = New RelayCommand(AddressOf HiddenLine, AddressOf CanHiddenLine) End If Return m_cmdHiddenLine End Get End Property ''' ''' Swith the view mode to HiddenLine. This method is invoked by the HiddenLineCommand. ''' Public Sub HiddenLine(ByVal param As Object) Application.Msn.NotifyColleagues(Application.HIDDENLINE) End Sub ''' ''' Returns always true. ''' Private Function CanHiddenLine(ByVal param As Object) As Boolean Return True End Function #End Region ' HiddenLineCommand #Region "ShadingCommand" ''' ''' Returns a command that swith the view mode to Shading. ''' Public ReadOnly Property ShadingCommand As ICommand Get If m_cmdShading Is Nothing Then m_cmdShading = New RelayCommand(AddressOf Shading, AddressOf CanShading) End If Return m_cmdShading End Get End Property ''' ''' Swith the view mode to Shading. This method is invoked by the ShadingCommand. ''' Public Sub Shading(ByVal param As Object) Application.Msn.NotifyColleagues(Application.SHADING) End Sub ''' ''' Returns always true. ''' Private Function CanShading(ByVal param As Object) As Boolean Return True End Function #End Region ' ShadingCommand #End Region ' COMMANDS End Class End Namespace