<Window x:Class="DevLeap.Linq.WPF.ComplexBinding"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WPF LINQ Sample Application" Height="418" Width="616"
Loaded="Window_Loaded">

<Window.Resources>
<DataTemplate x:Key="CustomerTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Path=CustomerID}" />
<TextBlock Grid.Column="1" Text="{Binding Path=ContactName}" />
<TextBlock Grid.Column="2" Text="{Binding Path=CompanyName}" />
</Grid>
</DataTemplate>
</Window.Resources>

<Canvas>
<TextBlock Canvas.Top="8" Height="18.96"
	Canvas.Left="9.183" Width="113">Customer ID:</TextBlock>
<TextBox Canvas.Top="5" Name="CustomerID"
Text="{Binding Path=CustomerID}" Height="21.96"
Canvas.Left="127" Width="84" />
<TextBlock Canvas.Top="40" Height="19"
	Canvas.Left="9.183" Width="113">Contact Name:</TextBlock>
<TextBox Canvas.Top="37" Name="ContactName"
Text="{Binding Path=ContactName}" Height="22"
Canvas.Left="127" Width="171" />
<TextBlock Canvas.Top="72" Height="19"
	Canvas.Left="8" Width="114.183">Company Name:</TextBlock>
<TextBox Canvas.Top="69" Name="CompanyName"
Text="{Binding Path=CompanyName}" Height="22"
Canvas.Left="127" Width="171" />
<Button Canvas.Left="8" Canvas.Top="105" Height="28"
Name="reloadCustomersList" Width="151"
Click="reloadCustomersList_Click">Reload Customers</Button>
<Button Canvas.Left="176" Canvas.Top="105" Height="28"
Name="addNewCustomer" Width="151"
Click="addNewCustomer_Click">Add a new Customer</Button>
<Button Canvas.Left="344" Canvas.Top="105" Height="28"
Name="deleteCustomer" Width="151"
Click="deleteCustomer_Click">Delete selected Customer</Button>
<StackPanel Margin="8,120,11,10" Name="panelCustomers"
Grid.ColumnSpan="2"
Height="233" Canvas.Left="0" Canvas.Top="27" Width="582">
<ListBox IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding}"
ItemTemplate="{StaticResource CustomerTemplate}"
Height="233" Width="582" />
</StackPanel>
</Canvas>
</Window>
