Files
EgtCAM5/OptionPanel/OptionPanelVM.vb
T
2026-03-12 11:31:10 +01:00

74 lines
2.5 KiB
VB.net

Imports EgtUILib
Public Class OptionPanelVM
Inherits BasePanelVM
Private m_DrawIsChecked As Boolean = True
Private m_MachiningIsChecked As Boolean = False
Dim DrawOptPanelV As DrawOptionPanelV
Dim MachOptPanelV As MachiningOptionPanelV
Dim DrawOptPanelVM As New DrawOptionPanelVM
Dim MachOptPanelVM As New MachiningOptionPanelVM
Public ReadOnly Property ModePanel As ContentControl
Get
If Not IsNothing(Map.refDrawOptionPanelVM) And Not IsNothing(Map.refMachiningOptionPanelVM) Then
If m_DrawIsChecked And Not m_MachiningIsChecked Then
Map.refMachiningOptionPanelVM.ExitMachiningOptionPanel()
Map.refDrawOptionPanelVM.InitDrawOptionPanel()
If DrawOptPanelV.DataContext IsNot Map.refDrawOptionPanelVM Then
DrawOptPanelV.DataContext = Map.refDrawOptionPanelVM
End If
Return DrawOptPanelV
End If
If m_MachiningIsChecked And Not m_DrawIsChecked Then
Map.refDrawOptionPanelVM.ExitDrawOptionPanel()
Map.refMachiningOptionPanelVM.InitMachiningOptionPanel()
If MachOptPanelV.DataContext IsNot Map.refMachiningOptionPanelVM Then
MachOptPanelV.DataContext = Map.refMachiningOptionPanelVM
End If
Return MachOptPanelV
End If
End If
DrawOptPanelV.DataContext = Nothing
MachOptPanelV.DataContext = Nothing
Return Nothing
End Get
End Property
Sub New()
Map.SetRefOptionPanelVM(Me)
SetPanelViewState(ViewPanelStates.ALWAYS)
DrawOptPanelV = New DrawOptionPanelV
MachOptPanelV = New MachiningOptionPanelV
End Sub
Friend Sub DrawMode_IsChecked()
m_DrawIsChecked = True
m_MachiningIsChecked = False
If Not IsNothing(Map.refSimulationExpanderVM) AndAlso
Not IsNothing(Map.refEstimationsExpanderVM) Then
Map.refSimulationExpanderVM.Simulation_IsExpanded = False
Map.refEstimationsExpanderVM.Estimation_IsExpanded = False
End If
If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.SetManageLayerIsExpanded(True)
NotifyPropertyChanged("ModePanel")
End Sub
Friend Sub MachiningMode_IsChecked()
m_DrawIsChecked = False
m_MachiningIsChecked = True
EgtZoom(ZM.ALL, False)
NotifyPropertyChanged("ModePanel")
End Sub
End Class