<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      HorizontalAlignment="Center" VerticalAlignment="Center">

<!-- Example 5-20. ListView control with controls for columns -->

<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
  <Grid.Resources>
    <XmlDataProvider x:Key="src" XPath="/Root">
      <x:XData>
        <Root xmlns="">
          <Item id="One" flag="True" value="A" />
          <Item id="Two" flag="True" value="B" />
          <Item id="Three" flag="False" value="C" />
          <Item id="Four" flag="True" value="D" />
        </Root>
      </x:XData>
    </XmlDataProvider>
  </Grid.Resources>

  <ListView DataContext="{StaticResource src}"
            ItemsSource="{Binding XPath=Item}">
    <ListView.View>
      <GridView>
        <GridViewColumn Header="ID"
                        DisplayMemberBinding="{Binding XPath=@id}" />

        <GridViewColumn Header="Enabled">
          <GridViewColumn.CellTemplate>
            <DataTemplate>
              <CheckBox IsChecked="{Binding XPath=@flag}" />
            </DataTemplate>
          </GridViewColumn.CellTemplate>
        </GridViewColumn>

        <GridViewColumn Header="Value">
          <GridViewColumn.CellTemplate>
            <DataTemplate>
              <TextBox Text="{Binding XPath=@value}" Width="70" />
            </DataTemplate>
          </GridViewColumn.CellTemplate>
        </GridViewColumn>
      </GridView>
    </ListView.View>
  </ListView>
</Grid>

<!-- End of Example 5-20. -->

</Page>