dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
6.94k stars 1.16k forks source link

ListBox does not react to "ScrollIntoView" if the last "Items.Add"s were the same. #9357

Open vsfeedback opened 1 month ago

vsfeedback commented 1 month ago

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]

->Listbox will scroll to last item only on button 2 (random item values)

.net 8 Preview 5


Original Comments

Alison Jin [MSFT] on 11/1/2023, 08:58 AM:

(private comment, text removed)

Person (2023-10-31 15:34:10Z) on 11/1/2023, 10:43 PM:

(private comment, text removed)

Feedback Bot on 11/6/2023, 00:32 PM:

(private comment, text removed)

Feedback Bot on 2/5/2024, 00:15 PM:

(private comment, text removed)


Original Solutions

(no solutions)


Repro

WPF_Listbox.zip

miloush commented 1 month ago

Well the two strings are identical, in this case even the same "instance", how would the ListBox know which one you want it to scroll to?

We could have an API overload that takes an index. (Also if your panel is VirtualizingStackPanel, it has BringIndexIntoViewPublic).