/
CustomService.vb
38 lines (28 loc) · 1016 Bytes
/
CustomService.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.UI
Imports DevExpress.Xpf.Grid
Imports System
Namespace BeginEndDataUpdate
Public Interface ICustomService
Sub BeginUpdate()
Sub EndUpdate()
End Interface
Friend Class CustomService
Inherits ServiceBase
Implements ICustomService
Private ReadOnly Property ActuaGridControl As GridControl
Get
Return TryCast(AssociatedObject, GridControl)
End Get
End Property
Protected Overrides Sub OnAttached()
If ActuaGridControl Is Nothing Then Throw New InvalidOperationException("This service can be attached only to the GridControl.")
MyBase.OnAttached()
End Sub
Public Sub BeginUpdate() Implements ICustomService.BeginUpdate
ActuaGridControl.BeginDataUpdate()
End Sub
Public Sub EndUpdate() Implements ICustomService.EndUpdate
ActuaGridControl.EndDataUpdate()
End Sub
End Class
End Namespace