scrollviewer

Sharing HorizontalOffset between two ScrollViewers created in different DataTemplates

会有一股神秘感。 提交于 2019-12-10 20:20:27
问题 I've got two ItemsControls, which use the same collection as an ItemsSource. ItemTemplates for both ItemsControls are very similar: there is a ScrollViewer inside both DataTemplates. Question: If I change HorizontalOffset in one of the ScrollViewers generated in the first ItemsControl, how can I scroll the ScrollViewer from the second ItemsControl, which has the same object as a DataContext , to the same HorizontalOffset? 回答1: As Rachel mentioned, there may be lots of solutions about your

DataGrids over ScrollViewer prevent it to scroll

妖精的绣舞 提交于 2019-12-10 18:53:27
问题 I have multiples DataGrids disposed over a ScrollViewer. These DataGrids have an "height: auto" property so that I can hide the scrollbar and view all the content. The only problem is that the DataGrids takes the focus and so I can't scroll the ScrollViewer. Is that a property to keep the focus on the ScrollViewer but also keeping the behaviour of the DataGrids (so I can select elements) ? Thank you ! 回答1: I ran across this exact same issue except my scenario was a little bit more complicated

WPF Click Button Scrollviewer

≡放荡痞女 提交于 2019-12-10 18:12:02
问题 i have the Problem that i have a Menu inside a Stackpanel, that is inside of an ScrollViewer. Now it's possible to scroll horizontally even if the Horizontally Scrollbar is Hidden. The Mainproblem now is, that i can't make a Clickevent for the buttons. It seems that my Scroll Event blocks something under it. The XAML Code <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="200"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="200"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions>

Include Adorner in ScrollViewer scrollable region

笑着哭i 提交于 2019-12-10 17:48:15
问题 I currently have an Adorner inside a ScrollViewer . Objects at the bottom of the scrollviewer can sometimes display a large adorner below them. Unfortunately, that adorner is not included in the ExtentHeight of the scrollviewer, so the lower portion of the adorner is clipped by the bottom of the scrollviewer's viewport. Is there a way to get the adorner layer's contents to be included in the scrollable region of the scrollviewer? 回答1: I'm afraid the consensus from other sources and hours of

How can I detect reaching the end of a ScrollViewer item (Windows 8)?

 ̄綄美尐妖づ 提交于 2019-12-10 16:19:28
问题 I need to do some work when the user scrolls to the end of a ScrollViewer in a Windows 8 'Metro UI' app that uses .xaml with C# behind-code. Alternatively, the ScrollViewer has snap-points enabled, so detecting a "snapping" event will also work. Thanks 回答1: You can bind your ListView to collection that implements ISupportIncrementalLoading. The extra items will be loaded automatically when there is an empty space to fill. 回答2: Maybe this could help: http://mikaelkoskinen.net/winrt-xaml

Zooming into image in Windows Store apps

谁都会走 提交于 2019-12-10 14:52:22
问题 I have a ScrollViewer with an Image Control in it. It displays a rather large image. I want my user to be able to zoom into the image using gestures. I therefore enabled the ZoomMode on the Scrollviewer. However the Scrollviewer automatically scrolls back to the left "edge" of the image whenever the user releases its finger, making effectively zooming in and out of the image impossible. This is the Template i am using: <DataTemplate x:Key="SingleItemTemplate"> <ScrollViewer ZoomMode="Enabled"

WinForm ScrollViewer

时光毁灭记忆、已成空白 提交于 2019-12-10 14:44:07
问题 I have an application in WPF that uses ScrollViewr and I want to port it to WinForms, is there an equivalent control for WinForms? Reason: WPF program is slow and I can't seem to learn how to render the program properly (GameOfLife). Code: <ScrollViewer Name="displayPlaceHolder" HorizontalScrollBarVisibility="Auto"> <Canvas Name="display" MouseMove="display_MouseMove" MouseDown="display_MouseDown" Cursor="Cross" KeyDown="global_KeyDown" Focusable="True" /> </ScrollViewer> 回答1: You could try

Wpf ScrollViewer Scroll Amount

烂漫一生 提交于 2019-12-10 12:32:21
问题 Is it possible to change the amount that the WPF ScrollViewer scrolls? I am simply wondering if it's possible to change the scrollviewer so that when using the mouse wheel or the scrollviewer arrows, the amount of incremental scrolling can be changed. 回答1: The short answer is: there is no way to do this without writing some custom scrolling code, but don't let that scare you it's not all that hard. The ScrollViewer either works by scrolling using physical units (i.e. pixels) or by engaging

Calculate a ScrollViewer's scrollbar offsets so that an object will be centered, while maintaining a layout transform who's scale is variable

空扰寡人 提交于 2019-12-10 12:16:32
问题 I have been fighting with this one for many hours now, and I just can't seem to arrive at an acceptable answer. I am hoping someone out there with much stronger geometry skills than my self can solve this riddle for me. Any help would be greatly appreciated. The nature of my problem, and description is below in the image that I provided. And here is a sample project that I have built, which does not correctly fulfill the requirements. XAML: <Window x:Class="MainWindow" xmlns="http://schemas

Zooming into all content of a Canvas

冷暖自知 提交于 2019-12-10 11:48:11
问题 I have this Xaml: <Grid x:Name="DrawingGrid" Visibility="Collapsed"> <AppBarButton x:Name="ExitDrawingButton" Icon="Cancel" Click="ExitDrawingButton_Click"></AppBarButton> <ScrollViewer x:Name="DScrollViewer" ManipulationMode="All" MaxZoomFactor="2.0" MinZoomFactor="1.0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" DoubleTapped="DScrollViewer_DoubleTapped" Width="1140" Height="770"> <Canvas x:Name="inkCanvas" Background="Transparent" Width="1140" Height="770">