-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewModel.vb
52 lines (37 loc) · 1.31 KB
/
ViewModel.vb
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
Imports DevExpress.Mvvm
Imports System.Collections.Generic
Imports System.Windows
Namespace dxSample
Public Class ViewModel
Public Sub New()
Items = New List(Of Item)()
For i As Integer = 0 To 5 - 1
Items.Add(New Item With {.Id = i, .Name = "Item " & i, .Position = New Point(i * 100, i * 200)})
Next
Connections = New List(Of Link)()
For i As Integer = 0 To 4 - 1
Connections.Add(New Link With {.From = Items(i).Id, .[To] = Items(i + 1).Id})
Next
Connections.Add(New Link With {.From = Items(4).Id, .[To] = Items(0).Id})
End Sub
Public Property Connections As List(Of Link)
Public Property Items As List(Of Item)
End Class
Public Class Item
Inherits BindableBase
Public Property Id As Integer
Public Property Name As String
Public Property Position As Point
Get
Return GetProperty(Function() Me.Position)
End Get
Set(ByVal value As Point)
SetProperty(Function() Position, value)
End Set
End Property
End Class
Public Class Link
Public Property From As Object
Public Property [To] As Object
End Class
End Namespace