b18e2f308f
- modificato il nome dell'UC per la creazione di una paretina - aggiunta controllo per la canellazione di part.
159 lines
4.6 KiB
VB.net
159 lines
4.6 KiB
VB.net
Public Class SceneButtonV
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Private m_refSceneButtonVM As SceneButtonVM
|
|
Public m_SelOptionUC As SelOptionV
|
|
Public m_SceneUserControlV As SceneUserControlV
|
|
Public m_PairUC As SceneUserControlV
|
|
Public m_RotateUC As SceneUserControlV
|
|
Public m_MoveUC As SceneUserControlV
|
|
Public m_NewPanelUC As SceneUserControlV
|
|
Public m_EditPanelUC As SceneUserControlV
|
|
Public m_ParametricCompoUC As SceneUserControlV
|
|
|
|
#End Region ' Fields & Properties
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
' La chiamata è richiesta dalla finestra di progettazione.
|
|
InitializeComponent()
|
|
|
|
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
|
m_refSceneButtonVM = Map.refSceneButtonVM
|
|
Map.SetRefSceneButtonVM(m_refSceneButtonVM)
|
|
SolidManagerM.ManageUndoRedo()
|
|
Me.DataContext = m_refSceneButtonVM
|
|
Map.SetRefSceneButtonV(Me)
|
|
AddHandler Me.Loaded, AddressOf SceneButtonV_Loaded
|
|
End Sub
|
|
|
|
#End Region ' Constructor
|
|
|
|
#Region "METHODS"
|
|
|
|
Public Sub Sizing()
|
|
Me.Width = Map.refMainWindowV.ActualWidth
|
|
Me.Height = Map.refMainWindowV.ActualHeight
|
|
End Sub
|
|
|
|
Private Sub SceneButtonV_Loaded(sender As Object, e As RoutedEventArgs)
|
|
Sizing()
|
|
End Sub
|
|
|
|
Public Sub LoadPairUC()
|
|
If IsNothing(m_PairUC) Then
|
|
m_PairUC = New SceneUserControlV
|
|
Dim m_PairVM As New PairVM()
|
|
m_PairUC.DataContext = m_PairVM
|
|
Grid.SetColumn(m_PairUC, 0)
|
|
Grid.SetRow(m_PairUC, 0)
|
|
Grid.SetColumnSpan(m_PairUC, 2)
|
|
Grid.SetRowSpan(m_PairUC, 3)
|
|
MainGrid.Children.Add(m_PairUC)
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub RemovePairUC()
|
|
MainGrid.Children.Remove(m_PairUC)
|
|
m_PairUC = Nothing
|
|
End Sub
|
|
|
|
Public Sub LoadRotateUC()
|
|
If IsNothing(m_RotateUC) Then
|
|
m_RotateUC = New SceneUserControlV
|
|
Dim m_RotateVM As New RotateVM()
|
|
m_RotateUC.DataContext = m_RotateVM
|
|
Grid.SetColumn(m_RotateUC, 0)
|
|
Grid.SetRow(m_RotateUC, 0)
|
|
Grid.SetColumnSpan(m_RotateUC, 2)
|
|
Grid.SetRowSpan(m_RotateUC, 3)
|
|
MainGrid.Children.Add(m_RotateUC)
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub RemoveRotateUC()
|
|
MainGrid.Children.Remove(m_RotateUC)
|
|
m_RotateUC = Nothing
|
|
End Sub
|
|
|
|
Public Sub LoadMoveUC()
|
|
If IsNothing(m_MoveUC) Then
|
|
m_MoveUC = New SceneUserControlV
|
|
Dim m_MoveVM As New MoveVM()
|
|
m_MoveUC.DataContext = m_MoveVM
|
|
Grid.SetColumn(m_MoveUC, 0)
|
|
Grid.SetRow(m_MoveUC, 0)
|
|
Grid.SetColumnSpan(m_MoveUC, 2)
|
|
Grid.SetRowSpan(m_MoveUC, 3)
|
|
MainGrid.Children.Add(m_MoveUC)
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub RemoveMoveUC()
|
|
MainGrid.Children.Remove(m_MoveUC)
|
|
m_MoveUC = Nothing
|
|
End Sub
|
|
|
|
Public Sub LoadNewPanelUC()
|
|
If IsNothing(m_NewPanelUC) Then
|
|
m_NewPanelUC = New SceneUserControlV
|
|
Dim m_NewPanelVM As New NewPanelVM()
|
|
m_NewPanelUC.DataContext = m_NewPanelVM
|
|
Grid.SetColumn(m_NewPanelUC, 0)
|
|
Grid.SetRow(m_NewPanelUC, 0)
|
|
Grid.SetColumnSpan(m_NewPanelUC, 2)
|
|
Grid.SetRowSpan(m_NewPanelUC, 5)
|
|
MainGrid.Children.Add(m_NewPanelUC)
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub RemoveNewPanelUC()
|
|
MainGrid.Children.Remove(m_NewPanelUC)
|
|
m_NewPanelUC = Nothing
|
|
End Sub
|
|
|
|
Public Sub LoadEditPanelUC()
|
|
If IsNothing(m_EditPanelUC) Then
|
|
m_EditPanelUC = New SceneUserControlV
|
|
Dim m_EditPanelVM As New EditPanelVM()
|
|
m_EditPanelUC.DataContext = m_EditPanelUC
|
|
Grid.SetColumn(m_EditPanelUC, 0)
|
|
Grid.SetRow(m_EditPanelUC, 0)
|
|
Grid.SetColumnSpan(m_EditPanelUC, 2)
|
|
Grid.SetRowSpan(m_EditPanelUC, 5)
|
|
MainGrid.Children.Add(m_EditPanelUC)
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub RemoveEditPanelUC()
|
|
MainGrid.Children.Remove(m_EditPanelUC)
|
|
m_EditPanelUC = Nothing
|
|
End Sub
|
|
|
|
|
|
|
|
Public Sub LoadParametricCompoUC(sFileName As String)
|
|
If IsNothing(m_ParametricCompoUC) Then
|
|
m_ParametricCompoUC = New SceneUserControlV
|
|
Dim m_ParametricCompoVM As New ParametricCompoVM(sFileName)
|
|
m_ParametricCompoUC.DataContext = m_ParametricCompoVM
|
|
Grid.SetColumn(m_ParametricCompoUC, 0)
|
|
Grid.SetRow(m_ParametricCompoUC, 0)
|
|
Grid.SetColumnSpan(m_ParametricCompoUC, 2)
|
|
Grid.SetRowSpan(m_ParametricCompoUC, 3)
|
|
MainGrid.Children.Add(m_ParametricCompoUC)
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub RemoveParametricCompoUC()
|
|
MainGrid.Children.Remove(m_ParametricCompoUC)
|
|
m_ParametricCompoUC = Nothing
|
|
End Sub
|
|
|
|
|
|
#End Region ' Methods
|
|
|
|
End Class
|