2

using WPF4 and Surface Toolkit 1.5 Beta I am adding items to a LibraryBar in a button click handler. I would like to have the LibraryBar scroll to the latest added item, like in this pseudo-code (Shortcut is a data class of my project):

private ObservableCollection<Shortcut> _items;

/* ... */

_items = new ObservableCollection<Shortcut>();
this.theShortcutLibraryBar.ItemsSource = _items;

/* ... */

Shortcut s = new Shortcut(description, transform);
_items.Add(s);

/* Version 1 */
this.theShortcutLibraryBar.ScrollIntoView(s);

/* Version 2 */
this.theShortcutLibraryBar.GetContainerElement(s).BringIntoView();

Sadly, there is no such ScrollIntoView method in a LibraryBar. Also, I did not find a way to get the container framework element of an item to call a BringIntoView method. Is there any workaround for this?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
HeBu
  • 125
  • 1
  • 8

0 Answers0