winRT xaml/C# listview selected index
-
hi@all! :-) i have a listview control in my winRT application and, when the user taps a tile, i´d like to save the previously selectedIndex. i can´t find an appropriate eventhandler to achieve this; i only found SelectionChanged-event, but, as one might guess, at this particular time the Event is already fired and i retrieve only the new selected index... can anyone please Point me to the right direction... eh, to the right Event ? and - if someone knows where to get an elaborated overview for the LifeCycle - as known form ASP.NET pages - that would be highly appreciated... ;) thanks in advance, Kind regards, clodetta
-
hi@all! :-) i have a listview control in my winRT application and, when the user taps a tile, i´d like to save the previously selectedIndex. i can´t find an appropriate eventhandler to achieve this; i only found SelectionChanged-event, but, as one might guess, at this particular time the Event is already fired and i retrieve only the new selected index... can anyone please Point me to the right direction... eh, to the right Event ? and - if someone knows where to get an elaborated overview for the LifeCycle - as known form ASP.NET pages - that would be highly appreciated... ;) thanks in advance, Kind regards, clodetta
-
hello, Marco. thank you for your suggestion!!! i´ll give that a try... i´m developing for surface, so I thought that this event isn´t what I want... i´ll report my findings... :) until then, clodetta edit: :-( that is winforms-related, I guess...
-
hello, Marco. thank you for your suggestion!!! i´ll give that a try... i´m developing for surface, so I thought that this event isn´t what I want... i´ll report my findings... :) until then, clodetta edit: :-( that is winforms-related, I guess...
Hmm... Can you just look for a similar event in the XAML-control? Another solution could be that you have a second variable where your current index is stored... You would have to update this variable manually and it would end up kinda unclean but this could be the emergency-solution.
-
Hmm... Can you just look for a similar event in the XAML-control? Another solution could be that you have a second variable where your current index is stored... You would have to update this variable manually and it would end up kinda unclean but this could be the emergency-solution.
Hi, Marco. sorry for replying late.... first of all: thank you for your help. :) I´ve found several events (ItemClick, Tapped etc) but none of them seem to suit. :(( your second suggestion leads me back to my initial question: where to save the old index...? I wonder what the softie´s intention was when they decided not to implement a SelectedIndex_Changing in addition to SelectedIndex_Changed. that would solve the issue perfectly... :sigh:
-
hi@all! :-) i have a listview control in my winRT application and, when the user taps a tile, i´d like to save the previously selectedIndex. i can´t find an appropriate eventhandler to achieve this; i only found SelectionChanged-event, but, as one might guess, at this particular time the Event is already fired and i retrieve only the new selected index... can anyone please Point me to the right direction... eh, to the right Event ? and - if someone knows where to get an elaborated overview for the LifeCycle - as known form ASP.NET pages - that would be highly appreciated... ;) thanks in advance, Kind regards, clodetta
ok, finally I got it... it´s more like right through the chest into the eye, but now it works... a healthy mixture of ListView.SelectedIndex_Change and Grid.GotFocus did the trick for me; now I can save the old AND the new index.... thanks to marco for his suggestions! post scriptum: I can´t find the checkbox for marking my thread as solved... I guess i´m blind...
-
Hi, Marco. sorry for replying late.... first of all: thank you for your help. :) I´ve found several events (ItemClick, Tapped etc) but none of them seem to suit. :(( your second suggestion leads me back to my initial question: where to save the old index...? I wonder what the softie´s intention was when they decided not to implement a SelectedIndex_Changing in addition to SelectedIndex_Changed. that would solve the issue perfectly... :sigh:
Clodetta del Mar wrote:
where to save the old index...?
Create a new control which inherits from the listview control. In the code-behind you can add the logic to handle the case and are maybe able to fire your own, custom selected index changing event...
cheers, Marco Bertschi
-
Clodetta del Mar wrote:
where to save the old index...?
Create a new control which inherits from the listview control. In the code-behind you can add the logic to handle the case and are maybe able to fire your own, custom selected index changing event...
cheers, Marco Bertschi
That´s also a good idea, but I have already solved the problem, I think, I´ll leave it at that. it now works the way it should, that´s sufficient for me! Thank you again for your help! kind regards! clodetta :)
-
That´s also a good idea, but I have already solved the problem, I think, I´ll leave it at that. it now works the way it should, that´s sufficient for me! Thank you again for your help! kind regards! clodetta :)
Clodetta del Mar wrote:
Thank you again for your help!
You are welcome...
cheers, Marco Bertschi