-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomService.cs
34 lines (28 loc) · 911 Bytes
/
CustomService.cs
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
using DevExpress.Mvvm.UI;
using DevExpress.Xpf.Grid;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace BeginEndDataUpdate {
public interface ICustomService {
void BeginUpdate();
void EndUpdate();
}
class CustomService : ServiceBase, ICustomService {
GridControl ActuaGridControl { get { return AssociatedObject as GridControl; } }
protected override void OnAttached() {
if(ActuaGridControl == null)
throw new InvalidOperationException("This service can be attached only to the GridControl.");
base.OnAttached();
}
public void BeginUpdate() {
ActuaGridControl.BeginDataUpdate();
}
public void EndUpdate() {
ActuaGridControl.EndDataUpdate();
}
}
}