Chapter 8: Building Desktop Applications with WPF 245
C#:
private MyShopDataContext m_ctx = new MyShopDataContext();
private void Window_Loaded(object sender, RoutedEventArgs e)
{
CollectionViewSource orderViewSource =
FindResource("orderViewSource") as CollectionViewSource;
orderViewSource.Source =
from ord in m_ctx.Orders
select ord;
}
VB:
Dim m_ctx As New MyShopDataContext
Private Sub Window_Loaded(
ByVal sender As System.Object,
ByVal e As System.Windows.RoutedEventArgs)
Handles MyBase.Loaded

Figure 8-16 Displaying information in a Grid