scrollviewer

Windows Phone: how to disable touch scrolling in ScrollViewer (Listbox)?

南笙酒味 提交于 2019-12-10 09:45:39
问题 i have a scrollviewer with a listbox inside: i need to disable the vertical scroll by touch, how can i? In other words, the user can't scroll with the touch (i have put buttons, but this is another story). <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" x:Name="imagesScrollview" Width="480" Height="595" Margin="0,112,0,63"> <ScrollViewer.RenderTransform> <CompositeTransform/> </ScrollViewer.RenderTransform> <ListBox Name="listavideo" Height="595"

ItemsControl, VirtualizingStackPanel and ScrollViewer height

放肆的年华 提交于 2019-12-10 02:52:06
问题 I want to display a important list of items using an ItemsControl. The reason why I'm using an ItemsControl is that the DataTemplate is much more complex in the application I'm working on: The sample code provided only reflects the sizing problem I have. I would like : the ItemsControl to be virtualized because there is many items to display its size to expand to its parent container automatically (the Grid) <Grid> <ItemsControl x:Name="My" ItemsSource="{Binding Path=Names}"> <ItemsControl

WPF Scrollviewer on touch screen tablet

天涯浪子 提交于 2019-12-10 02:39:59
问题 I'm writing a WPF application that is going to run on a full windows 8 touchscreen tablet (not RT). However touch scrolling doesn't seem to be working. So I'm wondering if it's something I'm doing wrong or if it's even possible? So, I have a WPF window with a scrollviewer. Within that scrollviewer I have a StackPanel which has loads of textblocks within it. See below: <ScrollViewer> <StackPanel> <TextBlock Text="Row 1" /> <TextBlock Text="Row 2" /> <TextBlock Text="Row 3" /> <TextBlock Text=

How can I make WPF ScrollViewer middle-click-scroll?

和自甴很熟 提交于 2019-12-09 09:18:30
问题 Clicking the middle mouse button (aka: mouse wheel) and then moving the mouse down slightly lets users scroll in IE, and most Windows apps. This behavior appears to be missing in WPF controls by default? Is there a setting, a workaround, or something obvious that I'm missing? 回答1: I have found how to achieve this using 3 mouse events ( MouseDown , MouseUp , MouseMove ). Their handlers are attached to the ScrollViewer element in the xaml below: <Grid> <ScrollViewer MouseDown="ScrollViewer

How to add a grid inside a Scroll viewer programmatically

僤鯓⒐⒋嵵緔 提交于 2019-12-08 15:29:44
问题 My XAML looks like this <navigation:Page x:Class="SilverlightApplication1.Home"> <Grid x:Name="LayoutRoot"> <!-- <ScrollViewer> <Grid> <TextBlock Text="myTextBlock" /> </Grid> </ScrollViewer> --> </Grid> I want to programmatically do the commented part above via code behind. And my code behind looks like this public partial class Home : Page { public Home() { InitializeComponent(); ScrollViewer sv = new ScrollViewer(); Grid grid = new Grid(); TextBlock block = new TextBlock(); block.Text =

Scrollviewer & Canvas

China☆狼群 提交于 2019-12-08 13:01:34
I am trying to load an image within a canvas such that, if the size of image overflows the canvas, the scroll bars should get activated (MS Paint style) <Window> <ScrollViewer> <Canvas ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible"> <Image Source="SampleImage.jpg" /> </Canvas> </ScrollViewer> </Window> Now as Canvas is stretched to Window 's size, scroll-bars won't appear as Canvas is not actually overflowing out of the Window . Secondly, as the Image is much bigger than the Canvas , it is getting clipped at the bounds of Canvas , so

fire (call) method, when scrollviewer scrolled to its end

久未见 提交于 2019-12-08 11:59:20
问题 after being googled a lot, finally i am going to ask this to you guys. i'v created scrollviewer , which contains items( listboxItems ) and these items fetching from the webservices . but at once only 5 items can fetched. so initially it'll be 5 items, then next 5(appended to the scrollviewer ) and then next 5 and so on...... note:-here listBoxitems are used inside the scrollviewer , not the listbox data fetched from webservice also contains ---> total items numResults (current number of items

A way to get a “button press event” for a WPF ScrollViewer control

廉价感情. 提交于 2019-12-08 09:41:51
问题 My custom control uses a ScrollViewer and I want to determine when the user presses the horizontal scroll increment button while the control is already scrolled to the horizontal max. The viewer contains a canvas and the idea is the canvas will extend if the user tries to scroll past its extent with the buttons. ScrollViewer doesn't appear to have any events which relate to the buttons specifically and ScrollChanged is no use on its own since it doesn't trigger when the bar is at its extent.

ScrollViewer notify on RequestBringIntoView

冷暖自知 提交于 2019-12-08 08:24:40
问题 I am attempting to get notified when an element is scrolled into view , As i understand it , ScrollViewer calls BringIntoView on it's child elements and then the child elements raise a RequestBringIntoView event which the ScrollViewer later catches and handles. This is done by Registering a Class handler for this Event and catching it as it bubbles up EventManager.RegisterClassHandler(typeof(ScrollViewer), RequestBringIntoViewEvent, new RequestBringIntoViewEventHandler(OnRequestBringIntoView)

Detect when ScrollViewer has stopped scrolling

你说的曾经没有我的故事 提交于 2019-12-08 05:52:37
问题 I have a SurfaceListBox that inside has a ScrollViewer . I have access to that ScrollViewer and I want to detect when the scrolling ends. Since it is a touch app and I can drag it, right now I'm detecting the PreviewTouchUp to do what I want, however, if I do a fast swipe, like you would do on a smartphone, because the content of the ScrollViewer is still dragging/scrolling, the PreviewTouchUp does not reflect the end of the scrolling, but is instead triggered before. I have tried