-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainViewModel.vb
37 lines (31 loc) · 1.43 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
Imports DevExpress.Mvvm
Imports DevExpress.Mvvm.DataAnnotations
Imports DevExpress.Mvvm.POCO
Namespace DXSampleNotificationSevice.ViewModel
<POCOViewModel>
Public Class MainViewModel
<ServiceProperty(Key:="ServiceWithDefaultNotifications")>
Protected Overridable ReadOnly Property DefaultNotificationService As INotificationService
Get
Return Nothing
End Get
End Property
<ServiceProperty(Key:="ServiceWithCustomNotifications")>
Protected Overridable ReadOnly Property CustomNotificationService As INotificationService
Get
Return Nothing
End Get
End Property
Public Sub ShowDefaultNotification()
Dim notification As INotification = DefaultNotificationService.CreatePredefinedNotification("Predefined Notification", "First line", String.Format("Second line. Time: {0}", Date.Now), Nothing)
notification.ShowAsync()
End Sub
Public Sub ShowCustomNotification()
Dim vm As CustomNotificationViewModel = ViewModelSource.Create(Function() New CustomNotificationViewModel())
vm.Caption = "Custom Notification"
vm.Content = String.Format("Time: {0}", Date.Now)
Dim notification As INotification = CustomNotificationService.CreateCustomNotification(vm)
notification.ShowAsync()
End Sub
End Class
End Namespace