EgtCAM5 :

- correzione gestione ComboBox in input/modifica dati di entità.
This commit is contained in:
Dario Sassi
2025-12-04 16:06:30 +01:00
parent 4d610cea8b
commit 9946b15588
2 changed files with 16 additions and 17 deletions
@@ -166,21 +166,20 @@ Public Class InputExpanderVM
Set(value As Integer)
If m_bTempShow Then Map.refProjectVM.SetLastInteger(value)
m_ComboSelectedIndex = value
Dim tmpComboSelectedIndex As Integer = ComboSelectedIndex
If m_ComboSelectedIndex >= 0 AndAlso tmpInfoList.Count > 0 Then
' se la info è presente la aggiungo alla textbox per modificarla
If m_TextBox IsNot String.Empty Then
If String.IsNullOrEmpty(m_TextBox) Then
m_TextBox = (tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValue).Trim()
Else
If Not m_TextBox.EndsWith(vbCrLf) Then m_TextBox &= vbCrLf
m_TextBox &= (tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValour).Trim()
ElseIf m_TextBox Is String.Empty Then
m_TextBox &= (tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValour).Trim() & vbCrLf
m_TextBox &= (tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValue).Trim()
End If
ComboVisibility = Visibility.Collapsed
ComboItemsList.Remove((tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValour).Trim())
tmpInfoList.Remove(tmpInfoList(tmpComboSelectedIndex))
ComboItemsList.RemoveAt(m_ComboSelectedIndex)
tmpInfoList.RemoveAt(m_ComboSelectedIndex)
m_ComboSelectedIndex = -1
If ComboItemsList.Count <= 0 Then ShowInfoItemVisibility = Visibility.Collapsed
End If
m_ComboSelectedIndex = -1
If ComboItemsList.Count <= 0 Then ShowInfoItemVisibility = Visibility.Collapsed
OnPropertyChanged("ComboSelectedIndex")
OnPropertyChanged("ComboItemsList")
OnPropertyChanged("TextBox")
@@ -346,7 +345,7 @@ Public Class InputExpanderVM
Dim sSplitItem As String() = m_TextBox.Split("="c)
Dim ItemCombo As InfoItem = tmpInfoList.FirstOrDefault(Function(x) x.sKey = sSplitItem(0))
If Not IsNothing(ItemCombo) Then
ComboItemsList.Remove((ItemCombo.sKey & "=" & ItemCombo.sValour).Trim())
ComboItemsList.Remove((ItemCombo.sKey & "=" & ItemCombo.sValue).Trim())
tmpInfoList.Remove(ItemCombo)
End If
End If
@@ -452,7 +451,7 @@ Public Class InputExpanderVM
Next
For Each InfoItem As InfoItem In tmpInfoList
ComboItemsList.Add((InfoItem.sKey & "=" & InfoItem.sValour).Trim())
ComboItemsList.Add((InfoItem.sKey & "=" & InfoItem.sValue).Trim())
Next
End If
End Sub