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 8854789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:57:53+00:00 2026-06-14T13:57:53+00:00

This should be a trivial Task but I can’t find how to do it.

  • 0

This should be a trivial Task but I can’t find how to do it. I want to listen to a click on an item in a listview, get the corresponding model object, and launch a new screen.

This is the XAML for the ListView:

<ListView x:Name="ItemListView" 
    ItemTemplate="{StaticResource StoreFrontTileTemplate}"
    ItemContainerStyle="{StaticResource StoreFrontLVTileStyle}"
    Margin="0" VerticalAlignment="Top" ItemClick="MyClick" Tapped="MyTap"/>

And MyClick, MyTap:

private void MyClick(object sender, ItemClickEventArgs e)
{
    Debug.WriteLine("Click!");
}

private void MyTap(object sender, TappedRoutedEventArgs e)
{
    Debug.WriteLine("TAp!!" + sender.ToString() + "--" + e.ToString());
}

The method to navigate to the new screen:

this.Frame.Navigate(typeof(SecondScreen));

It works, but I need the model object of the clicked item and pass it as a Parameter to the second screen.

But MyClick is never called, and MyTap doesn’t give me any Information about the clicked item. “sender” is the ListView.

I downloaded these exaples:

http://code.msdn.microsoft.com/windowsapps/XAML-ListView-sample-pack-0ec6b60f

But it doesn’t contain what I need, there’s a master / detail view, but it works with bindings and what I want to do is launch a complete new screen.

Note: I’m a noob in Windows development and orienting to the usual way to do it in Android or IOS where you implement a callback with the position of the clicked element. No idea about the right way to do it in Windows 8.

  • 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-06-14T13:57:54+00:00Added an answer on June 14, 2026 at 1:57 pm

    You can use the SelectionChanged event:

    <ListView x:Name="ItemListView" SelectionChanged="MySelectionChanged" />
    

    And you can get the selected/deseleted items from the SelectionChangedEventArgs e.g.:

    private void MySelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        Debug.WriteLine("Selected: {0}", e.AddedItems[0]);
    }
    

    Or if you don’t need the selection functionality and what to use the ItemClick="MyClick"
    you need to set IsItemClickEnabled to true:

    Gets or sets a value that indicates whether items in the view raise an ItemClick event in response to interaction.

    <ListView x:Name="ItemListView" 
        ItemTemplate="{StaticResource StoreFrontTileTemplate}"
        ItemContainerStyle="{StaticResource StoreFrontLVTileStyle}"
        Margin="0" VerticalAlignment="Top" ItemClick="MyClick"  
        IsItemClickEnabled="bool" SelectionMode="None"/>
    

    Note that in this case you also need to set the SelectionMode to None.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be trivial but I can't seem to find it (unless no such
This should be trivial and obvious but I can't find any examples of this.
This should be a trivial question. But I am confused. I want to print
I imagine this should be a pretty trivial task but using Firefox for Mac,
this should be trivial to some but I don't get it :s if Message
I feel like this should be trivial, but I've struggled to find anything useful
This should be quite simple, but I can't work out the syntax. I have
This should be a simple issue but I can't figure this out. I have
This should be pretty trivial but for whatever reason, I'm having a little trouble
This should be incredibly trivial, but it's not. I have a predefined height for

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.