private void Window_Loaded(object sender, RoutedEventArgs e) { // get goals using (var db = new GoalsManagementContext()) { var query = from g in db.Goals orderby g.Priority select g; this.dgGoals.ItemsSource = query.ToList(); } }
private void dgGoals_MouseUp(object sender, MouseButtonEventArgs e) { // get tasks for selected goal using (var db = new GoalsManagementContext()) { var query = from t in db.Tasks orderby t.Priority select t; this.dgTasks.ItemsSource = query.ToList(); } }