diff --git a/CompoWindow/CompoListPage/CompoListPageV.xaml b/CompoWindow/CompoListPage/CompoListPageV.xaml index 39c1706..a641324 100644 --- a/CompoWindow/CompoListPage/CompoListPageV.xaml +++ b/CompoWindow/CompoListPage/CompoListPageV.xaml @@ -27,15 +27,20 @@ - + + + + + + + diff --git a/CompoWindow/CompoListPage/CompoListPageVM.vb b/CompoWindow/CompoListPage/CompoListPageVM.vb index 3da6812..374e0b6 100644 --- a/CompoWindow/CompoListPage/CompoListPageVM.vb +++ b/CompoWindow/CompoListPage/CompoListPageVM.vb @@ -14,6 +14,17 @@ Public Class CompoListPageVM End Get End Property + Private m_CompoManagerControl As CompoManagerV + Public Property CompoManagerControl As CompoManagerV + Get + Return m_CompoManagerControl + End Get + Set(value As CompoManagerV) + m_CompoManagerControl = value + NotifyPropertyChanged("CompoManagerControl") + End Set + End Property + Private m_BackVisibility As Visibility Public ReadOnly Property BackVisibility As Visibility Get @@ -40,6 +51,16 @@ Public Class CompoListPageVM Friend Sub InitCompoListPage() RefreshCompoList() + ' porto in CompoParam il CompoManager + If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelCompo) Then + CompoWindowMap.refCompoParamPageVM.CompoManagerControl = Nothing + CompoManagerControl = Nothing + Else + CompoWindowMap.refCompoParamPageVM.CompoManagerControl = Nothing + CompoManagerControl = CompoWindowMap.refCompoWindowVM.CompoManagerV + End If + ' lancio inizializzazione CompoManager + CompoWindowMap.refCompoManagerVM.InitCompoManager() End Sub Private Sub RefreshCompoList() @@ -47,9 +68,12 @@ Public Class CompoListPageVM If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelCompoFamily) Then LoadMainCompoList() m_BackVisibility = Visibility.Collapsed - Else + ElseIf IsNothing(CompoWindowMap.refCompoWindowVM.m_SelCompo) Then LoadSelCompoList() m_BackVisibility = Visibility.Visible + Else + LoadInternalCompoList() + m_BackVisibility = Visibility.Visible End If NotifyPropertyChanged("BackVisibility") End Sub @@ -73,12 +97,18 @@ Public Class CompoListPageVM Private Sub LoadSelCompoList() Dim SelCompoIndex As Integer = CompoWindowMap.refCompoWindowVM.m_SelCompoFamily.Index Dim CompoNumber As Integer = GetMainPrivateProfileInt("Compo" & SelCompoIndex, "Count", 0) - Dim sCompoImage As String = String.Empty For CompoIndex = 1 To CompoNumber m_CompoList.Add(GetPrivateProfileCompo("Compo" & SelCompoIndex, "Compo" & CompoIndex)) Next End Sub + Private Sub LoadInternalCompoList() + Dim CompoNumber As Integer = GetMainPrivateProfileInt("InternalCompo", "Count", 0) + For CompoIndex = 1 To CompoNumber + m_CompoList.Add(GetPrivateProfileCompo("InternalCompo" & CompoIndex, "InternalCompo" & CompoIndex)) + Next + End Sub + Public Function GetPrivateProfileCompo( ByVal lpAppName As String, ByVal lpKeyName As String) As CompoItem @@ -124,9 +154,12 @@ Public Class CompoListPageVM Else RefreshCompoList() End If - Else + ElseIf IsNothing(CompoWindowMap.refCompoWindowVM.m_SelCompo) Then CompoWindowMap.refCompoWindowVM.m_SelCompo = DirectCast(param, CompoItem) CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.PARAM + Else + CompoWindowMap.refCompoWindowVM.m_SelInternalCompo = DirectCast(param, CompoItem) + CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.PARAM End If End Sub @@ -146,8 +179,15 @@ Public Class CompoListPageVM ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded. Public Sub Back(ByVal param As Object) - CompoWindowMap.refCompoWindowVM.m_SelCompoFamily = Nothing - RefreshCompoList() + If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelCompo) Then + CompoWindowMap.refCompoWindowVM.m_SelCompoFamily = Nothing + InitCompoListPage() + Else + CompoWindowMap.refCompoWindowVM.m_SelCompo = Nothing + InitCompoListPage() + EgtNewFile() + EgtDraw() + End If End Sub #End Region ' BackCommand diff --git a/CompoWindow/CompoManager/CompoManagerV.xaml b/CompoWindow/CompoManager/CompoManagerV.xaml new file mode 100644 index 0000000..6e6c5f5 --- /dev/null +++ b/CompoWindow/CompoManager/CompoManagerV.xaml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +