-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainViewModel.vb
38 lines (35 loc) · 1.07 KB
/
MainViewModel.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
Imports DevExpress.Mvvm
Imports System.Linq
Imports System.Collections.ObjectModel
Imports DXDocumentUIServiceSample.Common
Imports DevExpress.Mvvm.DataAnnotations
Namespace DXDocumentUIServiceSample.ViewModel
Public Class MainViewModel
Inherits ViewModelBase
Private ReadOnly Property DocumentManagerService() As IDocumentManagerService
Get
Return Me.GetService(Of IDocumentManagerService)()
End Get
End Property
Public Property Users() As ObservableCollection(Of UserViewModel)
Get
Return GetValue(Of ObservableCollection(Of UserViewModel))()
End Get
Set(ByVal value As ObservableCollection(Of UserViewModel))
SetValue(value)
End Set
End Property
Public Sub New()
Users = DataHelper.GetUsers()
End Sub
<Command>
Public Sub CreateDocument(ByVal arg As Object)
Dim doc As IDocument = DocumentManagerService.FindDocument(arg)
If doc Is Nothing Then
doc = DocumentManagerService.CreateDocument("DetailedView", arg)
doc.Id = DocumentManagerService.Documents.Count()
End If
doc.Show()
End Sub
End Class
End Namespace