1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.Windows.Threading
Public Class MesDatas
Implements INotifyPropertyChanged
Private _DicoInputDown As ObservableCollection(Of KeyValuePair(Of Integer, Integer))
Private _DicoOutputDown As ObservableCollection(Of KeyValuePair(Of Integer, Integer))
Public Event PropertyChanged(sender As Object, e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Public Sub OnPropertyChanged(ByVal propname As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propname))
End Sub
Public Sub New()
DicoOutputDown = New ObservableCollection(Of KeyValuePair(Of Integer, Integer))
AddCollection(DicoOutputDown, 0, 40)
AddCollection(DicoOutputDown, 1, 30)
AddCollection(DicoOutputDown, 2, 50)
AddCollection(DicoOutputDown, 3, 20)
AddCollection(DicoOutputDown, 4, 60)
AddCollection(DicoOutputDown, 5, 52)
DicoInputDown = New ObservableCollection(Of KeyValuePair(Of Integer, Integer))
AddCollection(DicoInputDown, 0, 58)
AddCollection(DicoInputDown, 5, 52)
End Sub
Private Sub AddCollection(ByRef col As ObservableCollection(Of KeyValuePair(Of Integer, Integer)), ByVal key As Integer, ByVal value As Integer)
col.Add(New KeyValuePair(Of Integer, Integer)(key, value))
End Sub
Public Property DicoInputDown() As ObservableCollection(Of KeyValuePair(Of Integer, Integer))
Get
Return _DicoInputDown
End Get
Set(value As ObservableCollection(Of KeyValuePair(Of Integer, Integer)))
_DicoInputDown = value
OnPropertyChanged("DicoInputDown")
End Set
End Property
Public Property DicoOutputDown() As ObservableCollection(Of KeyValuePair(Of Integer, Integer))
Get
Return _DicoOutputDown
End Get
Set(value As ObservableCollection(Of KeyValuePair(Of Integer, Integer)))
_DicoOutputDown = value
OnPropertyChanged("DicoOutputDown")
End Set
End Property
End Class |
Partager