horizontaloffset

WPF - Animate ListBox.ScrollViewer.HorizontalOffset?

若如初见. 提交于 2019-12-17 15:41:35
问题 I have a collection of Visual s in a ListBox . I need to find the XPosition of an element inside it and then animate the HorizontalOffset of the ListBox 's ScrollViewer . Essentially I want to created an animated ScrollIntoView method. This gives me a couple of problems. Firstly, how can I get a reference to the ListBox s scrollviewer? Secondly, how can i get the relative XPosition or HozintalOfffset of an arbitrary element in the ListBox ? I'm not reponding to any input on the ListBox itself

WPF - Animate ListBox.ScrollViewer.HorizontalOffset?

给你一囗甜甜゛ 提交于 2019-11-27 19:30:41
I have a collection of Visual s in a ListBox . I need to find the XPosition of an element inside it and then animate the HorizontalOffset of the ListBox 's ScrollViewer . Essentially I want to created an animated ScrollIntoView method. This gives me a couple of problems. Firstly, how can I get a reference to the ListBox s scrollviewer? Secondly, how can i get the relative XPosition or HozintalOfffset of an arbitrary element in the ListBox ? I'm not reponding to any input on the ListBox itself so I can't use Mouse related properties. I don't think you will be able to use a WPF storyboard for