views:

203

answers:

0

Hello.

I'm developing a Windows Phone application. I have defined a ListBox.ItemTemplate's DataTemplate as follows:

<ListBox Margin="10,10,8,8" x:Name="ChoicesList">
  <ListBox.ItemsPanel>
    <ItemsPanelTemplate>
      <StackPanel />
    </ItemsPanelTemplate>
  </ListBox.ItemsPanel>
  <ListBox.ItemTemplate>
    <DataTemplate>
      <Grid x:Name="ListBoxItemLayout" Background="Transparent" Margin="10">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="0.281*"/>
          <ColumnDefinition Width="0.719*"/>
        </Grid.ColumnDefinitions>
        <Image Source="{Binding ImagePath}" Height="100"/>
        <StackPanel Margin="5,0,0,0" Grid.Column="1">
          <TextBlock x:Name="Name" TextWrapping="Wrap" Text="{Binding Name}" Style="{StaticResource PhoneTextTitle3Style}"/>
          <TextBlock x:Name="Description" Margin="0,5,0,0" TextWrapping="Wrap" Text="{Binding Description}" d:LayoutOverrides="Width" Style="{StaticResource PhoneTextSmallStyle}"/>
          <TextBlock x:Name="Rating" TextWrapping="Wrap" Text="{Binding Rating}" />
        </StackPanel>
      </Grid>
    </DataTemplate>
  </ListBox.ItemTemplate>
</ListBox>

I want to convert all the content inside the ListBoxItem as a Control because I want to add a Click event to it.

How can I do this?

Thank you.