in Education by
I've seen similar questions asked about WPF, but none of the proposed solutions seem to work under Windows Phone 7. Basically, I've got a listbox where the behavior needs to be 1) when user taps an item in the list, it's selected. 2) when user taps any other item, the first is unselected and the tapped item is selected (so far this is just normal single select list box behavior) 3) when user taps an already selected item, the item "unselects" (so that there is no selected item at all anymore). It's certainly easy enough to intercept the MouseLeftButtonDown event and clear the selection, but the ui system appears to continue processing the tab and turns around an reselects the item I've just unselected. At first, I thought binding could be the problem, and the list items +are+ bound to an observableCollection, but neither the "selectedItem" or "selectedIndex" are bound at all. I tried setting the event args handled prop to true: e.Handled = true but no change. Any ideas? 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
Use MouseLeftButtonUp() rather than MouseLeftButtonDown(). private object _selected; private void ListBox_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var list = (ListBox) sender; if (list.SelectedItem == _selected) { list.SelectedIndex = -1; _selected = null; } else { _selected = list.SelectedItem; } }

Related questions

0 votes
    I have a ListBox that scrolls images horizontally. I have the following XAML I used blend to create it. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Please refer to my test case https://jsfiddle.net/1c3Lmace/13/ This is my code $(document).ready( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I am developing a Windows 8 metro application that uses semantic zoom in the following way: The zoomed in ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
0 votes
    I basically have 2 python scripts one is for frontend other is for backend. On Frontend I have this: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 11, 2022 in Education by JackTerrance
0 votes
    So I tried reading the file and I confirmed it worked and then tried adding the contents to a listbox ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I am trying to fill options into a listbox dynamically. I want to set a fixed width even there is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I am trying to fill options into a listbox dynamically. I want to set a fixed width even there is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I need to find a way to clear the Listbox for the refresh function which I am making. The function should ... clearing the Listbox) Select the correct answer from above options...
asked Jan 18, 2022 in Education by JackTerrance
0 votes
    When a transaction Ti attempts to update a data item, it requests a _________ on that data item. ... Snapshot Isolation topic in chapter Concurrency Control of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    ________ can be used to establish risk and stability estimations on an item of code, such as a class or method ... code (2)Defect density (3)Risk density (4)Cyclomatic complextiy...
asked May 15, 2021 in General by JackTerrance
0 votes
    I am trying to model the UX for search as follows: How can I shift the search bar to the top of ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Aug 1, 2022 in Education by JackTerrance
0 votes
    I want to click on group add button of Facebook, but I have not found it possible using an xpath. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm new to flutter and can't resolve the issue. Your application could not be compiled, because its ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    I'm new to flutter and can't resolve the issue. Your application could not be compiled, because its ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 15, 2022 in Education by JackTerrance
0 votes
    *Updated with more relevant code. *Updated again: removing chart groupings results in this error: "Unable to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
...