-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMyShowSearchController.cs
26 lines (23 loc) · 1.22 KB
/
MyShowSearchController.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
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
using dxTestSolution.Module.BusinessObjects;
using MySolution.Module.BusinessObjects;
namespace dxTestSolution.Module.Controllers {
public class MyShowSearchController : ObjectViewController<ListView, Contact> {
public MyShowSearchController() {
var mypopAction1 = new PopupWindowShowAction(this, "MyShowSearchAction", PredefinedCategory.Edit);
mypopAction1.TargetViewNesting = Nesting.Root;
mypopAction1.CustomizePopupWindowParams += MyAction1_CustomizePopupWindowParams;
}
private void MyAction1_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) {
var nonPersistentOS = (NonPersistentObjectSpace)Application.CreateObjectSpace(typeof(MySearchClass));
var persistentOS = Application.CreateObjectSpace(typeof(Contact));
nonPersistentOS.AdditionalObjectSpaces.Add(persistentOS);
var obj = nonPersistentOS.CreateObject<MySearchClass>();
nonPersistentOS.CommitChanges();
var view = Application.CreateDetailView(nonPersistentOS, obj);
e.View = view;
}
}
}