in Education by (1.9m 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.9m 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.

Related questions

0 votes
asked Mar 5 in Education by JackTerrance (1.9m points)
+1 vote
asked Nov 8, 2020 in Technology by JackTerrance (1.9m points)
...