How can I create wpf Carousel withmy listview items?

When the Prev/Left button is clicked, call ScrollViewer.LineLeft() When the Right/Next button is clicked, call ScrollViewer.LineRight() The simplest way to access the ScrollViewer in a ListView is to do a top-down search of the visual tree, for example: var scrollViewer = SearchVisualTree(listView); private T SearchVisualTree(Visual vis) where T:Visual { if(vis==null) return null; var range = Enumerable. Range(0, VisualTreeHelper. GetChildrenCount(vis)); return ( from I in range let child = VisualTreeHelper.

GetChild(vis, i) as T where child! =null select child ). Concat( from j in range let descendant = SearchVisualTree(VisualTreeHelper.

GetChild(vis, j) as Visual) where descendant! =null select descendant ).FirstOrDefault(); }.

When the Prev/Left button is clicked, call ScrollViewer.LineLeft(). When the Right/Next button is clicked, call ScrollViewer.LineRight(). The simplest way to access the ScrollViewer in a ListView is to do a top-down search of the visual tree, for example: var scrollViewer = SearchVisualTree(listView); private T SearchVisualTree(Visual vis) where T:Visual { if(vis==null) return null; var range = Enumerable.

Range(0, VisualTreeHelper. GetChildrenCount(vis)); return ( from I in range let child = VisualTreeHelper. GetChild(vis, i) as T where child!

=null select child ). Concat( from j in range let descendant = SearchVisualTree(VisualTreeHelper. GetChild(vis, j) as Visual) where descendant!

=null select descendant ).FirstOrDefault(); }.

I am getting compile time error in let child = VisualTreeHelper. GetChild(vis, i) as T Error:The type parameter 'T' cannot be used with the 'as' operator because it does not have a class type constraint nor a 'class' constraint – ashish semwal Jun 12 '10 at 7:33 Sorry, I forgot to constrain T. I added a "where T:Visual" to the code in the answer, so now it should work.

– Ray Burns Jun 13 '10 at 3:31 thanks a lot dude..! – ashish semwal Jun 13 '10 at 10:38 I appreciate your help but I don't think so it will work like Carousel on horizontal listview items! – ashish semwal Jun 13 '10 at 12:43 1 Every time I have read your question I find myself wondering what you really mean by "horizontal listview". The only interpretation I can think of is that you have or something like it that you want to manipulate.Is this correct?

If not, please post the XAML for the control you are trying to scroll. Thanks. – Ray Burns Jun 13 '10 at 5:03.

The simplest way to access the ScrollViewer in a ListView is to do a top-down search of the visual tree, for example: var scrollViewer = SearchVisualTree(listView); private T SearchVisualTree(Visual vis) where T:Visual { if(vis==null) return null; var range = Enumerable. GetChildrenCount(vis)); return ( from I in range let child = VisualTreeHelper. GetChild(vis, i) as T where child!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions