scrollviewer

Slider \\ ScrollViewer in a touch interface not working properly

隐身守侯 提交于 2019-11-28 11:20:23
In WPF I've got the following XAML: <ScrollViewer Canvas.Left="2266" Canvas.Top="428" Height="378" Name="scrollViewer1" Width="728" PanningMode="VerticalOnly" PanningRatio="2"> <Canvas Height="1732.593" Width="507.667"> <Slider Height="40.668" x:Name="slider1" Width="507.667" Style="{DynamicResource SliderStyle1}" Canvas.Left="15" Canvas.Top="150" /> </Slider> </Canvas> </ScrollViewer> It's a ScrollViewer containing a Slider. I'm using the following on a touch-screen, and I'm using the panning even to scroll the ScrollViewer vertically. When PanningMode="VerticalOnly" is set, the slider stops

ISupportIncrementalLoading inside ScrollViewer not supported?

允我心安 提交于 2019-11-28 10:15:13
问题 I have a GridView with GridView.ItemsSource set to a collection that implements ISupportIncrementalLoading. By implementing this, I am aiming to improve load time and UI responsiveness by only loading items that are needed for display. The framework handles this for me and it works great. <GridView ItemsSource="{Binding Items}"> <GridView.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Text}"/> </DataTemplate> </GridView.ItemTemplate> </GridView> However , if I wrap the above XAML in a

ScrollBars are not visible after changing positions of controls inside a Canvas

只愿长相守 提交于 2019-11-28 10:01:18
问题 I created a custom canvas control inheriting from WPF Canvas . I am using it like this in main window - <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <RTD:RTDesignerCanvas Margin="5" Background="White" x:Name="canvas1" Focusable="True" AllowDrop="True"> </RTD:RTDesignerCanvas> </ScrollViewer> Everything works fine but when I try to set the position of controls inside it like this Canvas.SetTop(item, 200); scrollbars are not visible and control is

ScrollViewer not scrolling in WPF

断了今生、忘了曾经 提交于 2019-11-28 07:15:12
I am using a scrollviewer control around my stack panel which contains an ItemsControl. When there are many items in the ItemsControl it is suppose to scroll but for some reason it just cuts of the items. Here is the code: <StackPanel> <ScrollViewer CanContentScroll="True" VerticalScrollBarVisibility="Visible"> <ItemsControl Name="icEvents" Width="Auto" Height="100" Background="AliceBlue" ItemsSource="{Binding Path=EventSources}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="Source:"/> <TextBlock Text="{Binding Path=Source}" /> <TextBlock Text="Original Source:"/>

ScrollViewer mouse wheel not working

廉价感情. 提交于 2019-11-28 05:39:10
I am currently working on my first WPF project and trying to make a listview scrollable. At first I thought this could be easily done by simply limiting the listview's width and height and thus forcing a scrollbar to appear automatically whenever the content exceeds its space. This seemed fine at first but due to the handled PreviewMouseDown-Event (which enables dragging the list's items) it doesn't work after selecting an item. Second attempt (using ScrollViewer) <ScrollViewer> <ListView ItemsSource="{Binding FileViewModels}" PreviewMouseDown="ListView_MouseMove" Height="450" Width="200"/> <

Use ScrollViewer inside another Scrollviewer

こ雲淡風輕ζ 提交于 2019-11-28 04:36:59
问题 The structure of my wpf application is like: <Scrollviewer> <Grid> <Scrollviewer> <DataGrid> My Goal is, if the DataGrid exceeds the height of the screen to use it's own Scrollviewer. At the Moment only the outside ScrollViewer is used and so i have to scroll the whole Grid. Can someone please tell me how to do this? 回答1: You need to set a height on the inner ScrollViewer, otherwise it'll stretch as much as it needs based on it's content's size. <Window x:Name="RootWindow"> <ScrollViewer>

WPF Remove ScrollViewer from TreeView

烈酒焚心 提交于 2019-11-27 23:36:07
I was wondering if it is possible to turn off the TreeView's ScrollViewer easily. I have a UserControl with a Grid. One of the Cells has a few TreeViews inside a Stackpanel. The height of the Control sizes automatically depending on the height of the TreeViews, so there is no need for a scrollbar. The problem is: I have a bunch of these in a ListBox with its own ScrollViewer, but when i am using the MouseWheel, scrolling stops when you are over a TreeView. This is because the TreeView has its own ScrollViewer which steals the MouseWheel. I know this is probably possible by overriding the

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

允我心安 提交于 2019-11-27 21:11:12
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 adjusting the scroll position. If I am doing it in the View side I can call listBox.ScrollInToView

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

ScrollViewer's Viewport Height VS Actual Height [duplicate]

♀尐吖头ヾ 提交于 2019-11-27 16:25:06
问题 This question already has answers here : WPF DataGrid : CanContentScroll property causing odd behavior (2 answers) Closed 6 years ago . Both are quite general terms but I'm curious to know when these height will be different apart from the case we're using Virtualization? One more question: I read on MSDN: If CanContentScroll is true, the values of the ExtentHeight, ScrollableHeight, ViewportHeight, and VerticalOffset properties are number of items. If CanContentScroll is false, the values of