-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ListBox scroll issue. #268
base: master
Are you sure you want to change the base?
Conversation
When a listbox contains items that are not of type "ListBoxItem" then scrolling causes item selection. There is an issue that demonstrates that (IssueTests/listbox.fap). The above change fixes the problem but I am not very sure if it is the right way to handle it.
Good find. |
Thanks Brad. |
Looks like you're checking to see if the current item is a UIElement as to whether to reuse a recycled container. This doesn't feel right. I would guess that selection problems would be in proximity to the selection code. I'm open to being proved wrong with tests. |
I'm struggling to put together a test that demonstrates the problem. The reason I'm checking if the current item is a UIElement before setting it to a recycled item is because the cache is only supposed to contain UIElement items. My listbox does not contain items of ListBoxItem type and this is only when the error occurs. |
A few lines above you are also checking for a UIElement before setting generator.Current to a UIElement. |
I see where you're headed. In the following, we are testing to see whether the user's "Item" is already of type
The point of the following is to pull a container out of the recycled cache instead of generating a new one. We would want to do this if the current "Item" was not a
|
When a listbox contains items that are not of type "ListBoxItem" then scrolling causes item selection. There is an issue that demonstrates that (IssueTests/listbox.fap). The above change fixes the problem but I am not very sure if it is the right way to handle it.