Cannot set ScrollUnit or ContentScroll in Windows Store App - wpf

I have a VirtualizingStackPanel with Horizontal orientation. I am looking for a way to make the ScrollViewer scroll to content rather than by pixel.
I know that .NET 4.5 brought the ScrollUnit property, however I can't find it on WinRT. There's no ContentScroll too.

ListViewBase has a ScrollIntoView method which is what you would use to scroll to items. You could simply scroll with that to any given item in your list control.

Related

WPF based treeview with Hierarchy with Virtualization

I've following requirement while designing UI for application.
We have hierarchy as shown below
Level1
Level2.1
Level3
1000Thumbnails..... (inside Wrap Panel which is inside ListBox)
Level2.2
Level3
1000Thumbnails..... (inside Wrap Panel which is inside ListBox)
We would like to enable virtualization for thumbnails as amount of controls can go beyond 1000.
However, for virtualization to work, we need to restrict the size of ListBox within TreeView. With this limitation we end up having two scroll bars as shown in the image above.
Is there anyway we can avoid scroll viewer in ListBox but still have virtualization and scrolling (using mouse) thumbnails possible using ScrollViewer of TreeView control?
Kindly let me know if you need more information.
Thanks in advance for help!
You could just hide the Scrollbar, as described in this nice article.

Making a custom(/templated) ScrollViewer or ListBox that understands which item to bring to view

I am trying to make a panorama-like control in WPF c# that scrolls to/brings into view only one grid from a horizontal set of grids. I need to expose the command which allows me to scroll forward/backward from various controls (which using an InteractionTrigger would suffice) on any of the grids in the ScrollViewer or ListBox.
I want each of the internal grids to size to the actual height/width of the usercontrol they live in (like tiled pages), won't need any scrollbars, and will eventually be applying easing effects/states to each of the scroll positions.
If this is too vague/convoluted, please let me know.
Thanks in advance! :)
Easy Solution:
PathListBox. Downloaded the PathListBox toolkit (for the PathListBoxScrollBehavior), set the capacity to 1, and used the templated InteractionTriggers to bind various source objects on my grids to the InvokeCommandAction Increment/Decrement Commands. Then I added easing effects/GoToStateActions.
I realize this is sort of a cheat, but am still going to search for the "real" way to do this with custom control templates deriving from ListBox and/or ScrollViewer.

Change number of lines mouse wheel scrolls in WPF ListBox

In a WPF listbox, rotating mouse wheel will scroll list by the number of lines specified in Windows Control Panel, in Mouse Wheel options.
How can I change this, for example I want to scroll WPF ListBox, one line anytime, using mouse wheel.
Thank you.
As you stated it is a control panel setting and you are trying to override it. That will confuse the user. I recommend you to not do that.
However you could try and override various events and position the vertical scrolling by using scrollViewer.ScrollToVerticalOffset(...);
As stated by ygoe in a comment, what you are looking for is :
ScrollViewer.CanContentScroll="False"
In my tests, it does scroll the list one line at a time.
Of course, you should consider that it overrides a global windows setting, as stated by Erno

Silverlight drag n drop element hides when outside of ListBox

I implemented a drag and drop of an image from a Grid to another Grid using built-in MouseDragElementBehavior class. Then I needed to use a bit more complex layout for the source items so used ListBox and ItemTemplate instead.
The problem is now when dragging an item from the ListBox it is only visible when above the ListBox. How do I make it always visible and following mouse cursor anywhere while being dragged?
I suggest that instead of writing your own implementation using the Blend SDK, that you use the Silverlight Toolkit ListBoxDragDropTarget control.
The reason the item disappears in your element is that the MouseDragElementBehaviour is simplistically applying a render transform to affect the movement. However the ListView places its item panel inside a ScrollViewer which clips its content to its viewport.

Silverlight: How to display items in a grid?

I'm using Silverlight 4. I know how to display items in a vertical or horizontal list using a ListControl or ItemsControl. However, I want to display items in a grid, like you'd see Windows Explorer viewing in grid of icons. How can I do this? Is there a control, or must I use a hack like ItemControls of ItemControls?
you probably want the wrappanel in the silverlight toolkit. here's an old example but you get the idea: http://blogs.silverlight.net/blogs/justinangel/archive/2008/11/05/silverlight-toolkit-wrappanel.aspx

Resources