Imports System.Collections.ObjectModel Namespace Infragistics.Samples.Models.Series Public Class NumericDataSample Inherits NumericDataCollection Public Sub New() Me.Add(New NumericDataPoint() With { .X = 1, .Y = 1 }) Me.Add(New NumericDataPoint() With { .X = 2, .Y = 2 }) Me.Add(New NumericDataPoint() With { .X = 3, .Y = 6 }) Me.Add(New NumericDataPoint() With { .X = 4, .Y = 8 }) Me.Add(New NumericDataPoint() With { .X = 5, .Y = 2 }) Me.Add(New NumericDataPoint() With { .X = 6, .Y = 6 }) Me.Add(New NumericDataPoint() With { .X = 7, .Y = 4 }) Me.Add(New NumericDataPoint() With { .X = 8, .Y = 2 }) Me.Add(New NumericDataPoint() With { .X = 9, .Y = 1 }) Dim index As Integer = 0 For Each dataPoint As NumericDataPoint In Items dataPoint.Index = System.Math.Max(System.Threading.Interlocked.Increment(index),index - 1) Next End Sub End Class Public Class NumericDataCollection Inherits ObservableCollection(Of NumericDataPoint) End Class Public Class NumericDataPoint Inherits ObservableModel #Region "Properties" Private _y As Double Public Property Y() As Double Get Return _y End Get Set If _y = value Then Return End If _y = value OnPropertyChanged("Y") End Set End Property Private _x As Double Public Property X() As Double Get Return _x End Get Set If _x = value Then Return End If _x = value OnPropertyChanged("X") End Set End Property Private _index As Integer Public Property Index() As Integer Get Return _index End Get Set If _index = value Then Return End If _index = value End Set End Property #End Region Public Shadows Function ToString() As String Return [String].Format("Index {0}, X {1}, Y {2}", Index, X, Y) End Function End Class Public MustInherit Class ObservableModel Implements INotifyPropertyChanged Protected Sub New() End Sub #Region "INotifyPropertyChanged" Public Event PropertyChanged As PropertyChangedEventHandler Protected Sub OnPropertyChanged(propertyName As String) Dim handler As PropertyChangedEventHandler = Me.PropertyChanged RaiseEvent handler(Me, New PropertyChangedEventArgs(propertyName)) End Sub Public Sub OnAsyncPropertyChanged(propertyName As String) If PropertyChanged IsNot Nothing Then Deployment.Current.Dispatcher.BeginInvoke(Function() RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName)) End Function) End If End Sub #End Region End Class End Namespace