0 votes
in Education by (1.3m points)
I am developing a Windows 8 metro application that uses semantic zoom in the following way:

The zoomed in view contains a ListView with complex controls that allow for user interaction (by using TextBox and Button controls), therefore this ListView has IsItemClickEnabled="False". The user must trigger the zoomed out view manually.

The zoomed out view contains another ListView which displays a simple list that displays some status information for the controls in the zoomed in view. The ItemsSource property of this ListView is populated dinamically with plain objects that are created in the moment that the view is made active. This ListView has IsItemClickEnabled="True".

What do I want:

When the user taps or clicks on an item in the zoomed out view, the zoomed in view should activate and the control matching the clicked item should be made visible (the zoomed in ListView allows scrolling, so the control could be hidden). I know how to do this as long as the SelectionChanged event is triggered when a item is clicked.

What happens instead:

When the user taps or clicks on an item in the zoomed out view, the zoomed in view activates automatically and no SelectionChanged event is triggered. However, it works fine when using right click or Ctrl+click instead.

So, my question is:

Is there any way to make a ListView trigger the SelectionChanged event on item tap or left click, in addition to right click and Ctrl+click? If not, how can I detect the tap or left click?

Thank you very much!

JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by (1.3m points)
I found out the solution. I must control the Tapped event of the control that is inside the defined DataTemplate for the list, NOT the event of the ListView itself:

<SemanticZoom...>

    <SemanticZoom.ZoomedOutView>

        <ListView ...>

            <ListView.ItemTemplate>

                <DataTemplate>

                    <Border ... Tapped="Item_Tapped">

And in the Item_Tapped method, I just cast sender to FrameworkElement and look at its DataContext.

Learn More with Blogmepost

blogmepost Online Test

NCERT Questions & Answers

  • NCERT Class 12 Maths Solutions
  • NCERT Class 12 Physics Solutions
  • NCERT Class 12 Chemistry Solutions
  • NCERT Class 12 Biology Solutions
  • NCERT Class 10 Science Solutions
  • NCERT Class 10 Maths Solutions
blogmepost Q&A

CBSE Questions & Answers Portal

  • CBSE Class 12 Maths Questions Answers
  • CBSE Class 12 Physics Questions Answers
  • CBSE Class 12 Chemistry Questions Answers
  • CBSE Class 12 Biology Questions Answers
  • CBSE Class 10 Science Questions Answers
  • CBSE Class 10 Maths Questions Answers
Blogmepost

Learn Math Formula, Revise Notes

  • JEE Crash Course Questions & Answers
  • NCERT Course Questions and Answers
  • CBSE Board Questions Bank
  • ICSE Board Questions Bank
  • Free Study Materials
  • Question & Answers Bank for All Classes
  • Text Book Solutions
  • Previous Year Question Paper
  • NCERT Book Solutions

  • NCERT
  • NCERT Solutions
  • NCERT Solutions for Class 12 Maths
  • NCERT Solutions for Class 12 Physics
  • NCERT Solutions for Class 12 Chemistry
  • NCERT Solutions for Class 12 Biology
  • NCERT Solutions for Class 11 Maths
  • NCERT Solutions for Class 11 Physics
  • NCERT Solutions for Class 11 Chemistry
  • NCERT Solutions for Class 11 Biology
  • NCERT Solutions for Class 10 Maths
  • NCERT Solutions for Class 10 Science
  • NCERT Solutions for Class 9 Maths
  • NCERT Solutions for Class 9 Science
  • CBSE Classes

  • CBSE Class 5 Questions
  • CBSE Class 6 Questions
  • CBSE Class 7 Questions
  • CBSE Class 8 Questions
  • CBSE Class 9 Questions
  • CBSE Class 10 Questions
  • CBSE Class 10 Maths Questions
  • CBSE Class 11 Commerce Questions
  • CBSE Class 11 Engineering Questions
  • CBSE Class 11 Medical Questions
  • CBSE Class 12 Commerce Questions
  • CBSE Class 12 Maths Questions
  • CBSE Class 12 Engineering Questions
  • CBSE Class 12 Medical Questions
  • BOARDS

  • CBSE
  • ICSE
  • NCERT
  • IGCSE
  • Andhra Pradesh
  • Bihar
  • Gujarat
  • Jharkhand
  • Karnataka
  • Kerala
  • Madhya Pradesh
  • Maharashtra
  • Punjab
  • Rajasthan
...