scrollviewer

Synchronized scrolling of two ScrollViewers whenever any one is scrolled in wpf

你离开我真会死。 提交于 2019-11-26 22:41:38
I have gone through the thread: binding two VerticalScrollBars one to another it has almost helped to achieve the goal but still there is something missing. It is that moving the scrollbars left-right or up-down gives expected behavior of scrolling in both of my scrollviewers but when we try to scroll using/clicking arrow buttons at the ends of these scrollbars in scrollviewers only one scrollviewer is scrolled which is not the expected behavior. So what else we need to add/edit to solve this? Eirik One way to do this is using the ScrollChanged event to update the other ScrollViewer

How to control the scroll position of a ListBox in a MVVM WPF app

倖福魔咒の 提交于 2019-11-26 20:34:34
问题 I have got a big ListBox with vertical scrolling enabled, my MVVM has New and Edit ICommands. I am adding new item to the end of the collection but I want the scrollbar also to auto position to the End when I call my MVVM-AddCommand. I am also making an item editable(By calling EditCommand with a particular row item) from some other part of the application so that my ListBoxItem getting in to edit mode using DataTrigger, but how will I bring that particular row(ListBoxItem) to the view by

why setting ScrollViewer.CanContentScroll to false disable virtualization

孤街浪徒 提交于 2019-11-26 19:00:54
As most WPF developers know, setting ScrollViewer.CanContentScroll to false will disable virtualization; but I'd like to know how it works, because I try to enable virtualization while setting ScrollViewer.CanContentScroll to false . rudigrobler "ScrollViewer currently allows two scrolling modes: smooth pixel-by-pixel scrolling (CanContentScroll = false) or discrete item-by-item scrolling (CanContentScroll = true). Currently WPF supports UI virtualization only when scrolling by item. Pixel-based scrolling is also called “physical scrolling” and item-based scrolling is also called “logical

Accessing the ScrollViewer of a ListBox from C#

此生再无相见时 提交于 2019-11-26 17:48:00
问题 I'd like to change the properties of a ScrollViewer of a ListBox from C#. I found this question here on Stackoverflow. I took the accepted answer's advice and exposed the ScrollViewer as a property of a subclass. However, this doesn't appear to be working in an example shown below. Some of the comments in that question also state that this technique didn't work. XAML: <Window x:Class="StackoverflowListBoxScrollViewer.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation

WPF: ItemsControl with scrollbar (ScrollViewer)

会有一股神秘感。 提交于 2019-11-26 15:26:59
问题 I followed this small "tutorial" on how to add a scrollbar to an ItemsControl, and it works in Designer view, but not when I compile and execute the program (only the first few items show up, and no scrollbar to view more - even when VerticalScrollbarVisibility is set to "Visible" instead of "Auto"). Any idea on how to solve this? This is the code I use to show my items (normally I work with Databinding, but to see the items in my Designer I added them manually): <ItemsControl x:Name=

How to use ScrollViewer.ScrollToVerticalOffset?

六眼飞鱼酱① 提交于 2019-11-26 14:38:31
问题 I hope this isn't a duplicate but I can't find any documentation or examples on how to actually use ScrollToVerticalOffset() . I'm using it in a Windows Phone 8 app, but I think it will still apply to WP7 and Silverlight (although, feel free to correct me if I'm wrong). So here is my basic set up (pseudo-code from memory): <phone.PivotItem> <ScrollViewer> <Grid Height="1500"> <Grid.RowDefinitions> <!-- about 20 rows, all auto-height --> </Grid.RowDefinitions> <Border Grid.Row="0"> <TextBox x

How can I get ScrollViewer to work inside a StackPanel?

☆樱花仙子☆ 提交于 2019-11-26 14:36:45
In the following WPF XAML the ScrollViewer does not work (it displays a scroll bar but you cannot scroll and the contents go off the window to the bottom). I can change the outer StackPanel to a Grid and it will work. However, in my application from which I reproduced the following code, I need to have an outer StackPanel. What do I have to do to the StackPanel to make the ScrollViewer show a usable scrollbar? e.g. VerticalAlignment="Stretch" Height="Auto" don't work. <StackPanel> <ScrollViewer> <StackPanel> <TextBlock Text="This is a test"/> <TextBlock Text="This is a test"/> <TextBlock Text=

How to increase scrollbar width in WPF ScrollViewer?

China☆狼群 提交于 2019-11-26 13:02:31
问题 I am working on a touch screen on a small device and the custom width of the scroll-bar is no good as one of my requirements is that everything needs to be doable by finger gestures. How can I set the width of the WPF ScrollViewer scrollbar? Note that I don\'t wanna change the width of all the scrollbars on the device (doable through windows settings) - only the ones in my app. 回答1: The ScrollBar template reaches out for system parameters to determine its width/height (depending on

Synchronized scrolling of two ScrollViewers whenever any one is scrolled in wpf

馋奶兔 提交于 2019-11-26 08:24:00
问题 I have gone through the thread: binding two VerticalScrollBars one to another it has almost helped to achieve the goal but still there is something missing. It is that moving the scrollbars left-right or up-down gives expected behavior of scrolling in both of my scrollviewers but when we try to scroll using/clicking arrow buttons at the ends of these scrollbars in scrollviewers only one scrollviewer is scrolled which is not the expected behavior. So what else we need to add/edit to solve this

why setting ScrollViewer.CanContentScroll to false disable virtualization

拈花ヽ惹草 提交于 2019-11-26 06:44:48
问题 As most WPF developers know, setting ScrollViewer.CanContentScroll to false will disable virtualization; but I\'d like to know how it works, because I try to enable virtualization while setting ScrollViewer.CanContentScroll to false . 回答1: "ScrollViewer currently allows two scrolling modes: smooth pixel-by-pixel scrolling (CanContentScroll = false) or discrete item-by-item scrolling (CanContentScroll = true). Currently WPF supports UI virtualization only when scrolling by item. Pixel-based