Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7039289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:46:46+00:00 2026-05-28T01:46:46+00:00

I have a listbox with a datatemplate <Button Name=ButtonSortDate Content=Date Grid.Column=1 Click=ButtonSortDateClick /> <Button

  • 0

I have a listbox with a datatemplate

<Button Name="ButtonSortDate" Content="Date" Grid.Column="1" Click="ButtonSortDateClick" />
<Button Name="ButtonSortABC" Content="ABC.." Grid.Column="2" Click="ButtonSortABCClick" />
<!--ItemsSource="{Binding NotesCollection}"-->
<ListBox Name="ListBoxNotes" 
    Grid.Row="1" Grid.ColumnSpan="3"                             
    DoubleTap="DeleteDoubleTap">
    <ListBox.ItemTemplate>                            
        <DataTemplate>
            <StackPanel Margin="0,0,0,17" Width="432" Height="78" >
                <TextBlock Text="{Binding NoteText}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" />
                <TextBlock Text="{Binding Date}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
            </StackPanel>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

I want to be able to dobble tap an item in the List to delete it, but I cant find any way to get the clicked item, only the selected (Which is not always the same)

If I for example tap Item 1 in the list and dobble taps the second, then the ListBox.SelectedItem will be the first Item.

How do I get Item 2? Would be nice if I could put an event on the item itself somehow in the template

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:46:46+00:00Added an answer on May 28, 2026 at 1:46 am

    The e.OriginalSource should be some element within the item (e.g. one of the TextBlocks), it has the item as DataContext, so you should be able to remove the item from your source collection like this:

    var item = (FrameworkElement)e.OriginalSource;
    Data.Remove((MyItemType)item.DataContext);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this: <ListBox x:Name=PART_lstAttributes Grid.Row=1 Style={StaticResource GlossyBlackListBox}> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock x:Name=txtAttributeName Text={Binding
I have listbox that displays information about list of objects: <ListBox Grid.Column=0 Height=152 Name=CustomersList
I have a templated ListBox : <ListBox Grid.Row=0 Grid.Column=1 Background=Transparent BorderThickness=0 x:Name=mainMenu ItemsSource={Binding Source={x:Static
A have listbox <ListBox> <ListBox.ItemTemplate> <DataTemplate> <DockPanel> <Button Content={Binding name_trainer} Tag={Binding idPersonTrainer} DockPanel.Dock=Top HorizontalAlignment=Center>
I have a databound ListBox with a DataTemplate setup. The DataTemplate contains a Grid
So I have the following DataTemplate for a ListBox.ItemTemplate : <DataTemplate x:Key=Tweet> <Grid> <Grid.ColumnDefinitions>
I have a databound and itemtemplated ListBox: <ListBox x:Name=lbLista ScrollViewer.VerticalScrollBarVisibility=Visible> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation=Horizontal>
So I have this Xaml inside a ListBox Item Template: <ListBox.ItemTemplate> <DataTemplate> <Grid Height=22
I have a list box in expander: <ListBox ItemsSource={Binding MySource> <ListBox.ItemTemplate> <DataTemplate> <RadioButton Content={Binding
I have implemented a listbox with buttons as follows <Button.Content> <StackPanel Orientation=Horizontal Width=440 Height=210>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.