-
Notifications
You must be signed in to change notification settings - Fork 4
/
GridUpdateService.vb
41 lines (32 loc) · 1.1 KB
/
GridUpdateService.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
Imports DevExpress.Xpf.Grid
Imports System
Imports DevExpress.Mvvm.UI
Namespace DXGridThreads
Public Interface IGridUpdateService
Sub BeginUpdate()
Sub EndUpdate()
End Interface
Public Class GridUpdateService
Inherits ServiceBase
Implements IGridUpdateService
Private ReadOnly Property GridControl As GridControl
Get
Return TryCast(AssociatedObject, GridControl)
End Get
End Property
Public Sub BeginUpdate() Implements IGridUpdateService.BeginUpdate
Dispatcher.Invoke(New Action(Sub()
If GridControl IsNot Nothing Then
GridControl.BeginDataUpdate()
End If
End Sub))
End Sub
Public Sub EndUpdate() Implements IGridUpdateService.EndUpdate
Dispatcher.Invoke(New Action(Sub()
If GridControl IsNot Nothing Then
GridControl.EndDataUpdate()
End If
End Sub))
End Sub
End Class
End Namespace