Button in ListBox strange behaviour
On mobile devices when I have a Button inside a ListBoxItem and I want to press the button the ListBoxItem that contains the button gets selected.
How can I avoid that?
How can I avoid that?
Last edited by ivan_b on 18 Jul 2016, 09:33, edited 1 time in total.
-
- ai_enabled
- Posts: 231
- Joined:
- Contact:
Re: Button in ListBox strange behaiour
Hello!
This is strange. The event should be handled by the button and doesn't propagate to parent controls.
Can you reproduce the same issue on desktop, by using the same XAML styles/templates?
Regards!
This is strange. The event should be handled by the button and doesn't propagate to parent controls.
Can you reproduce the same issue on desktop, by using the same XAML styles/templates?
Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
Re: Button in ListBox strange behaiour
On desktop this issue does not happen.
Tere is also a problem when i use buttons as items inside an ItemsControl, in this case the IsPressed property is never true, my guess that the cause for this probelm is the same.
It probably has something to do with how ListBoxItem works when using touch events.
For now a workaround for this would be fine but I can't find any.
Thanks
Tere is also a problem when i use buttons as items inside an ItemsControl, in this case the IsPressed property is never true, my guess that the cause for this probelm is the same.
It probably has something to do with how ListBoxItem works when using touch events.
For now a workaround for this would be fine but I can't find any.
Thanks
-
-
sfernandez
Site Admin
- Posts: 3197
- Joined:
Re: Button in ListBox strange behaviour
Hi,
I tried both a ListBox and an ItemsControl and I was unable to reproduce that behavior.
In my tests only the Button is clicked and ListBoxItem is never selected unless item is touched outside the button. And if an ItemsControl is used the Button changes its visual state to pressed when a finger touches the Button.
Could you please create a ticket in our bugtracker and attach a simple sample where you can reproduce the problem?
I tried both a ListBox and an ItemsControl and I was unable to reproduce that behavior.
In my tests only the Button is clicked and ListBoxItem is never selected unless item is touched outside the button. And if an ItemsControl is used the Button changes its visual state to pressed when a finger touches the Button.
Could you please create a ticket in our bugtracker and attach a simple sample where you can reproduce the problem?
Re: Button in ListBox strange behaviour
If the ScrollViewer property PanningMode is set to "None" then it works but if it is set to "VerticalOnly" then the problem occours.
Re: Button in ListBox strange behaviour
Sorry for the delay Ivan. Sergio is out of the office till Friday. He will continue investigating the issue as soon as he is back.
Thanks!
Thanks!
-
-
sfernandez
Site Admin
- Posts: 3197
- Joined:
Re: Button in ListBox strange behaviour
Hi Ivan,
I have no problems neither using PanningMode=VerticalOnly, there must be something different in my tests.
Could you please post here (or better in the bugtracker) what you are trying to do?
Thanks.
I have no problems neither using PanningMode=VerticalOnly, there must be something different in my tests.
Could you please post here (or better in the bugtracker) what you are trying to do?
Thanks.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests