Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bring Control into ViewPort on Focus Change for ScrollViewer SL4

Basically I'm looking for something exactly like BringIntoViewOnFocusChange for SL4, I need whichever control has focus to automatically move into view of the ViewPort of a ScrollViewer whether it be Vertical or Horizontal scrolling enabled or both. So if say there's large view, with controls out of view, as a user tabs along it places whatever control that takes focus into view for smooth scrolling without having to do it manually.

I've done this with behaviors and setting VerticalOffset and attaching it to each individual object, but there has to be a better way and this has to have come up for folks often (except I couldnt find anything specific searching) so I'd really rather not re-invent the wheel here if I can. So please, share some enlightenment?

like image 566
Chris W. Avatar asked Nov 12 '22 11:11

Chris W.


1 Answers

I ended up going this route that happened to be what I was looking for and works splendid. Thanks to all who looked.

http://mattduffield.wordpress.com/2011/01/15/automatically-scrolling-to-a-selected-item-in-a-scrollviewer-in-silverlight/

like image 99
Chris W. Avatar answered Nov 15 '22 06:11

Chris W.