-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMainWindow.xaml.vb
28 lines (26 loc) · 963 Bytes
/
MainWindow.xaml.vb
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
Imports EFCoreIssues.Issues
Imports DevExpress.Data.Linq
Imports Microsoft.EntityFrameworkCore
Imports System.Linq
Imports DevExpress.Xpf.Grid
Class MainWindow
Public Sub New()
InitializeComponent()
Dim source = New EntityInstantFeedbackSource With {
.KeyExpression = NameOf(Issue.Id)
}
AddHandler source.GetQueryable, Sub(sender, e)
Dim context = New IssuesContext()
e.QueryableSource = context.Issues.AsNoTracking()
End Sub
grid.ItemsSource = source
LoadLookupData()
End Sub
Private Sub LoadLookupData()
Dim context = New IssuesContext()
usersLookup.ItemsSource = context.Users.[Select](Function(user) New With {
.Id = user.Id,
.Name = user.FirstName & " " + user.LastName
}).ToArray()
End Sub
End Class