-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMyCustomController.cs
More file actions
26 lines (20 loc) · 908 Bytes
/
MyCustomController.cs
File metadata and controls
26 lines (20 loc) · 908 Bytes
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 MySolution.Module.BusinessObjects;
namespace dxTestSolution.Module.Controllers {
public interface ICustomTemplate {
void SetCustomString(string _customString);
}
public abstract class MyCustomController : ObjectViewController<ListView, Contact> {
protected override void OnActivated() {
base.OnActivated();
this.View.SelectionChanged += View_SelectionChanged;
}
public abstract ICustomTemplate GetTemplate();
private void View_SelectionChanged(object sender, EventArgs e) {
var infoPanelTemplate = GetTemplate();
var selectedObjectNames = this.View.SelectedObjects.Cast<Contact>().Select(x => x.FirstName).ToList();
var finalString = string.Join("; ", selectedObjectNames);
infoPanelTemplate.SetCustomString(finalString);
}
}
}