Can I assign a click event to images? I would like to assign events to the delete and search buttons inside my list, which displays my data. Is there a way to do this using the image control or do I need to create a BLEND style for the button?
<ListBox x:Name="lbPills" ItemsSource="{Binding pillItemsCollection}" SelectionChanged="lbPills_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel x:Name="DataTemplateStackPanel" Orientation="Horizontal"> <TextBlock FontFamily="Segoe WP Semibold" FontWeight="Bold" FontSize="30" VerticalAlignment="Top" Margin="20,0">*</TextBlock> <StackPanel> <TextBlock x:Name="ItemText" Text="{Binding Name}" Margin="-2,-13,0,0" Style="{StaticResource PhoneTextExtraLargeStyle}"/> </StackPanel> <Image Source="Images/delete.png" Margin="10,0"/> <Image Source="Images/search.png" Margin="10,0"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
windows-phone-7 silverlight
webdad3
source share