Imports System.Data.Objects Public Class SearchMe Private db As New CraftingProjectsEntities Private ProjectsData As ProjectsCollection Private ProjectViewSource As CollectionViewSource Private WithEvents ProjectView As ListCollectionView Private Sub SearchMe_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded Dim query = From p In db.Projects Select p Me.ProjectsData = New ProjectsCollection(query, db) Me.ProjectViewSource = CType(Me.FindResource("ProjectViewSource"), CollectionViewSource) Me.ProjectView = CType(Me.ProjectViewSource.View, ListCollectionView) MyLists.ItemsSource = ProjectsData End Sub Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click Dim query = (From p In db.Projects Join c In db.Colorings On p.ProjectID Equals c.ProjectID Join s In db.Specials On p.ProjectID Equals s.ProjectID Select p).ToList() Me.ProjectsData = New ProjectsCollection(query.ToList(), db) MyLists.ItemsSource = ProjectsData End Sub Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click MyLists.ItemsSource = Nothing End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)