Files
EgtDOORCreator/DoorParameters/PartPageV.xaml.vb
T
Nicola Pievani 070e614d80 EgtDOORCreator 2.1i2:
-> gestione del materiale,
-> gestione delle proprietà autoescludenti,
-> aggiunta dello scrollBar nell'inserimento delle componenti,
-> evidenziazione in azzurro delle componenti aggiunte.
2019-10-09 17:04:29 +00:00

30 lines
1.7 KiB
VB.net

Public Class PartPageV
Public Sub ItemsControl_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
Dim ListControl As ListBox=DirectCast(sender,listbox)
If Not IsNothing( ListControl.SelectedItem) Then
Dim SelectedItemIndex As Integer = ListControl.Items.IndexOf(ListControl.SelectedItem)
ListControl.Dispatcher.BeginInvoke(DirectCast(Sub()
ListControl.UpdateLayout()
If ListControl.SelectedItem IsNot Nothing Then
ListControl.ScrollIntoView(ListControl.SelectedItem)
End If
End Sub, Action))
If SelectedItemIndex > 0 Then
ListControl.Dispatcher.BeginInvoke(DirectCast(Sub()
ListControl.UpdateLayout()
ListControl.ScrollIntoView(ListControl.Items(SelectedItemIndex - 1))
End Sub, Action))
End If
If SelectedItemIndex < ListControl.Items.Count - 2 Then
ListControl.Dispatcher.BeginInvoke(DirectCast(Sub()
ListControl.UpdateLayout()
ListControl.ScrollIntoView(ListControl.Items(SelectedItemIndex + 1))
End Sub, Action))
End If
End If
End Sub
End Class