-
Notifications
You must be signed in to change notification settings - Fork 3
/
RefreshNavigationController.cs
28 lines (27 loc) · 1.12 KB
/
RefreshNavigationController.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
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;
using dxTestSolution.Module.BusinessObjects;
namespace ItemCount.Module.Controllers {
public class RefreshNavigationController : ViewController {
public RefreshNavigationController() {
TargetViewNesting = Nesting.Root;
TargetObjectType = typeof(Email);
}
protected override void OnActivated() {
base.OnActivated();
View.ObjectSpace.Committed += ObjectSpace_Committed;
}
private void ObjectSpace_Committed(object sender, System.EventArgs e) {
ShowNavigationItemController controller = Application.MainWindow.GetController<ShowNavigationItemController>();
if(controller != null) {
controller.ShowNavigationItemAction.BeginUpdate();
controller.RecreateNavigationItems();
controller.ShowNavigationItemAction.EndUpdate();
}
}
protected override void OnDeactivated() {
View.ObjectSpace.Committed -= ObjectSpace_Committed;
base.OnDeactivated();
}
}
}