I have a problem with a listbox.ScrollIntoView
method - it does not work. Here is the code snippet:
// the listbox is binded to a "Thumbnails" property
this.Thumbnails = new VirtualizableCollection<RecordingThumbnailItem>(this.thumbnailsProvider) { ItemsStep = this.ThumbnailsStep };
this.listBox.ScrollIntoView(this.Thumbnails[thumbnailToSelect]);
I've noticed that if I call ScrollIntoView
a little bit later (for instance in 500 milliseconds after the source for a binding was defined) everything works. So I suppose that ScrollIntoView
should be invoked after the control will obtain some specific state;
if so, how can I detect it? Maybe using some event?
Eventually, I just need to enforce my horizontal listbox to show the last item in a right end, but not in a left as usual. Maybe some other approach exists?