-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMainViewModel.vb
More file actions
24 lines (22 loc) · 860 Bytes
/
MainViewModel.vb
File metadata and controls
24 lines (22 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Imports DevExpress.Mvvm
Imports XPOIssues.Issues
Imports DevExpress.Mvvm.DataAnnotations
Imports DevExpress.Xpo
Imports System.Linq
Imports System.Collections.Generic
Public Class MainViewModel
Inherits ViewModelBase
Private _UnitOfWork As UnitOfWork
Private _ItemsSource As IList(Of User)
Public ReadOnly Property ItemsSource As IList(Of User)
Get
If _ItemsSource Is Nothing AndAlso Not DevExpress.Mvvm.ViewModelBase.IsInDesignMode Then
_UnitOfWork = New UnitOfWork()
Dim xpCollection = New XPCollection(Of User)(_UnitOfWork)
xpCollection.Sorting.Add(New SortProperty(NameOf(User.Oid), DevExpress.Xpo.DB.SortingDirection.Ascending))
_ItemsSource = xpCollection
End If
Return _ItemsSource
End Get
End Property
End Class