-
Notifications
You must be signed in to change notification settings - Fork 0
/
WinCustomizeTabControlViewController.cs
38 lines (36 loc) · 1.38 KB
/
WinCustomizeTabControlViewController.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
35
36
37
38
using System;
using DevExpress.ExpressApp;
using DevExpress.XtraLayout;
using DevExpress.ExpressApp.Win.Layout;
namespace AccessLayout.Win {
public class WinCustomizeTabControlViewController : ViewController<DetailView> {
TabbedControlGroup tabbedGroup;
WinLayoutManager layoutManager;
protected override void OnActivated() {
base.OnActivated();
layoutManager = (WinLayoutManager)View.LayoutManager;
layoutManager.ItemCreated += OnItemCreated;
layoutManager.LayoutCreated += OnLayoutCreated;
}
void OnItemCreated(object sender, ItemCreatedEventArgs e) {
// Check this Id in the AccessLayoutEF.Module/Model.DesignedDiffs.xafml file
if (e.ModelLayoutElement.Id == "MyTabbedGroup") {
tabbedGroup = (TabbedControlGroup)e.Item;
}
}
private void OnLayoutCreated(object sender, EventArgs e) {
if (tabbedGroup != null) {
tabbedGroup.SelectedTabPageIndex = 1;
}
}
protected override void OnDeactivated() {
if (layoutManager != null) {
layoutManager.ItemCreated -= OnItemCreated;
layoutManager.LayoutCreated -= OnLayoutCreated;
layoutManager = null;
}
tabbedGroup = null;
base.OnDeactivated();
}
}
}