-
Notifications
You must be signed in to change notification settings - Fork 2
/
MainWindow.xaml.cs
33 lines (31 loc) · 1.48 KB
/
MainWindow.xaml.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
using System.Windows;
using XPOIssues.Issues;
using DevExpress.Data.Filtering;
using DevExpress.Xpo;
using System.Linq;
using DevExpress.Xpf.Grid;
namespace XPOIssues {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
var properties = new ServerViewProperty[] {
new ServerViewProperty("Subject", SortDirection.None, new OperandProperty("Subject")),
new ServerViewProperty("UserId", SortDirection.None, new OperandProperty("UserId")),
new ServerViewProperty("Created", SortDirection.None, new OperandProperty("Created")),
new ServerViewProperty("Votes", SortDirection.None, new OperandProperty("Votes")),
new ServerViewProperty("Priority", SortDirection.None, new OperandProperty("Priority")),
new ServerViewProperty("Oid", SortDirection.Ascending, new OperandProperty("Oid"))
};
var source = new XPInstantFeedbackView(typeof(Issue), properties, null);
source.ResolveSession += (o, e) => {
e.Session = new Session();
};
grid.ItemsSource = source;
LoadLookupData();
}
void LoadLookupData() {
var session = new Session();
usersLookup.ItemsSource = session.Query<User>().OrderBy(user => user.Oid).Select(user => new { Id = user.Oid, Name = user.FirstName + " " + user.LastName }).ToArray();
}
}
}