fbf5ff294e
- Gestita barra caricamento calcolo intersezioni
119 lines
3.3 KiB
VB.net
119 lines
3.3 KiB
VB.net
Imports EgtWPFLib5
|
|
Imports EgtUILib
|
|
|
|
Public Class SecondaryWindowVM
|
|
Inherits VMBase
|
|
|
|
' Titolo
|
|
Private m_sTitle As String
|
|
Public Property sTitle As String
|
|
Get
|
|
Return m_sTitle
|
|
End Get
|
|
Set(value As String)
|
|
m_sTitle = value
|
|
NotifyPropertyChanged(NameOf(sTitle))
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Visibility As Boolean
|
|
Public Property Visibility As Visibility
|
|
Get
|
|
Return If(m_Visibility, Visibility.Visible, Visibility.Collapsed)
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_Visibility = (value = Visibility.Visible)
|
|
End Set
|
|
End Property
|
|
|
|
Friend Sub SetVisibility(bValue As Boolean)
|
|
If bValue <> m_Visibility Then
|
|
m_Visibility = bValue
|
|
NotifyPropertyChanged(NameOf(Visibility))
|
|
End If
|
|
End Sub
|
|
|
|
Friend Sub SetTitle(sTitle As String)
|
|
m_sTitle = sTitle
|
|
NotifyPropertyChanged(NameOf(sTitle))
|
|
End Sub
|
|
|
|
' definizione comandi
|
|
Private m_cmdAboutBox As ICommand
|
|
Private m_cmdCloseApplication As ICommand
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
' Creo riferimento a questa classe in Map
|
|
Map.SetRefSecondaryWindowVM(Me)
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
Friend Sub ContentRendered()
|
|
Map.refTopPanelVM.SelPage = Pages.NULL
|
|
' Seleziono la macchina impostata nel file ini
|
|
Map.refMachinePanelVM.LoadCurrentMachine()
|
|
' imposto SnapPoint
|
|
Map.refMyStatusBarVM.SetSnapPointType(Map.refSceneHostVM.SnapType)
|
|
Map.refMyStatusBarVM.SetMeasureUnit(EgtUiUnitsAreMM)
|
|
EgtSetView(VT.ISO_SW, False)
|
|
' creo nuovo progetto di partenza
|
|
Map.refProjManagerVM.NewProject(False)
|
|
' leggo stati visualizzazione layer
|
|
Map.refViewLayerManagerVM.UpdateIsVisibleFromIni()
|
|
' resetto segnalazione modifiche
|
|
EgtResetModified()
|
|
End Sub
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "AboutBoxCommand"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property AboutBoxCommand() As ICommand
|
|
Get
|
|
If m_cmdAboutBox Is Nothing Then
|
|
m_cmdAboutBox = New Command(AddressOf AboutBox)
|
|
End If
|
|
Return m_cmdAboutBox
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub AboutBox(ByVal param As Object)
|
|
Dim AboutBoxWindow As New AboutBoxV
|
|
AboutBoxWindow.Owner = Application.Current.MainWindow
|
|
AboutBoxWindow.ShowDialog()
|
|
End Sub
|
|
|
|
#End Region ' AboutBoxCommand
|
|
|
|
#Region "CloseApplicationCommand"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property CloseApplicationCommand() As ICommand
|
|
Get
|
|
If m_cmdCloseApplication Is Nothing Then
|
|
m_cmdCloseApplication = New Command(AddressOf CloseApplication)
|
|
End If
|
|
Return m_cmdCloseApplication
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub CloseApplication(ByVal param As Object)
|
|
If Map.refSliceManagerVM.bCalculating Then
|
|
MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
|
Return
|
|
End If
|
|
Map.refMainWindowVM.CloseApplication()
|
|
End Sub
|
|
|
|
#End Region ' CloseApplicationCommand
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|