EgtCAM5 :
- correzione gestione ComboBox in input/modifica dati di entità.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -91,17 +91,17 @@ Public Class InfoItem
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend sValour As String
|
||||
Friend sValue As String
|
||||
''' <summary>
|
||||
''' Valore lista info note
|
||||
''' </summary>
|
||||
Public Property Valour As String
|
||||
Public Property Value As String
|
||||
Get
|
||||
Return sValour
|
||||
Return sValue
|
||||
End Get
|
||||
Set(value As String)
|
||||
sValour = value
|
||||
NotifyPropertyChanged(NameOf(Valour))
|
||||
sValue = value
|
||||
NotifyPropertyChanged(NameOf(Value))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -115,7 +115,7 @@ Public Class InfoItem
|
||||
Sub New(nId As Integer, sKey As String, sValue As String)
|
||||
Me.nId = nId
|
||||
Me.sKey = sKey
|
||||
Me.sValour = sValue
|
||||
Me.sValue = sValue
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
Reference in New Issue
Block a user