Chapter 8: Building Desktop Applications with WPF

245

Figure 8-16 Displaying information in a Grid

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

Page 268
Image 268
Microsoft 9GD00001 manual 245, Displaying information in a Grid