scrollviewer

disable mouse wheel scrolling in scrollviewer wpf

∥☆過路亽.° 提交于 2020-06-14 06:50:33
问题 In xaml code <StackPanel> <ScrollViewer> <local:CustomCanvas> </local:CustomCanvas> </ScrollViewer> </StackPanel> CustomCanvs has a zoom in/out function. But when I spin the mouse wheel in the CustomCanvas area, ScrollViewer's scrollbar works and zoom in/out don't work. And when I scroll the scrollbar of the ScrollViewer, not only CustomCanvas' zoom in/out work but also scrolling of the ScrollViewer work well. When I spin the mouse wheel, I want only zoom in/out. And when I scroll the

disable mouse wheel scrolling in scrollviewer wpf

我与影子孤独终老i 提交于 2020-06-14 06:50:06
问题 In xaml code <StackPanel> <ScrollViewer> <local:CustomCanvas> </local:CustomCanvas> </ScrollViewer> </StackPanel> CustomCanvs has a zoom in/out function. But when I spin the mouse wheel in the CustomCanvas area, ScrollViewer's scrollbar works and zoom in/out don't work. And when I scroll the scrollbar of the ScrollViewer, not only CustomCanvas' zoom in/out work but also scrolling of the ScrollViewer work well. When I spin the mouse wheel, I want only zoom in/out. And when I scroll the

Detect, if ScrollBar of ScrollViewer is visible or not

≯℡__Kan透↙ 提交于 2020-06-11 17:00:53
问题 I have a TreeView. Now, I want to detect, if the vertical Scrollbar is visible or not. When I try it with var visibility = this.ProjectTree.GetValue(ScrollViewer.VerticalScrollBarVisibilityProperty) (where this.ProjectTree is the TreeView) I get always Auto for visibility. How can I do this to detect, if the ScrollBar is effectiv visible or not? Thanks. 回答1: You can use the ComputedVerticalScrollBarVisibility property. But for that, you first need to find the ScrollViewer in the TreeView 's

WPF Nested Scrollviewers - giving control back to parent scollviewer

喜你入骨 提交于 2020-05-14 18:44:06
问题 This is what my control tree looks like: <window> <scrollviewer> <expander> <scrollviewer> <grid> </grid> </scrollviewer> </expander> <expander> <scrollviewer> <grid> </grid> </scrollviewer> </expander> </scrollviewer> </window> Using the mouse wheel, the control automatically passes from parent to child scrollviewer, but when I scroll to the end of the child scrollviewer the control doesn't pass back to the parent scorllviewer. How do I achieve this? The expander, grid and the scrollviewers

WPF - How could I get a scrollviewer control from my XAML file in C#?

你离开我真会死。 提交于 2020-03-06 02:34:08
问题 I need to get a specific ScrollViewer control from an XAML file in C#, so that I can try to implement a drag-and-scroll system where when an item is dragged near the edge it will scroll accordingly. But I need access to all the methods to do this, yet I cannot find any info as to how to get the specific scrollviewer from the XAML. I need access to it from a separate .cs file in which most of the project's converters and functions are located. Not sure bout the downvotes tho seeing as I did

Tooltip on scrollviewer in documentviewer

删除回忆录丶 提交于 2020-01-23 16:56:48
问题 I have a documentviewer which i used in my wpf project to show xps document reports of having around 600 pages which is working great. But from user point of view i like to show the current page number as a tooltip on my scrollviewer while dragging the scroll stating the current page number in view. Somewhat like in a PDF file like this - I was looking out for some ideas how to implement this. Just a current page number if not possible to show a thumbnail image would be good enough for me. Is

Tooltip on scrollviewer in documentviewer in case of deferred scrolling

南笙酒味 提交于 2020-01-23 09:45:09
问题 I want to show the tooltip on my scrollviewer on page scrolling which shows the current page number in it which i asked here- Tooltip on scrollviewer in documentviewer. I have implemented the answer after making some changes in the proposed solution but i face some problem. If i write this in my scroll_changed event if (Mouse.LeftButton == MouseButtonState.Pressed) it works perfectly fine but if i have a deferred scrolling enabled on my custom document viewer, the popup(tooltip) never appears

WP7 ScrollViewer Bug When Content Height > 2000px

纵然是瞬间 提交于 2020-01-21 08:57:45
问题 In my project, I use ScrollViewer to show some long height infomation. I use like this: <Grid Grid.Row="1" Height="630"> <ScrollViewer Background="Red" Grid.Row="1"> <Grid> <Rectangle Height="3000" Fill="LightBlue" Width="440"/> </Grid> </ScrollViewer> </Grid> But,unfortunately, the rectagnle don't show completely when scrollView bar's vertical height > 2000. I have tested without Grid as ScrollViewer's content, only with Rectangle, the result is the same. And the bug is also happens with

How to find that ScrollViewer is scrolled to the end in WPF?

余生颓废 提交于 2020-01-19 00:44:28
问题 I have a ScrollViewer instance in my custom control... I need the requirement that whether scorollview is scrolled to the End? Is there any way? 回答1: You can check this with this way: ... scrollViewer.ScrollChanged += OnScrollChanged; ... private void OnScrollChanged(object sender, ScrollChangedEventArgs e) { var scrollViewer = (ScrollViewer)sender; if (scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight) MessageBox.Show("This is the end"); } 回答2: Here is my MVVM-friendly version:

How to find that ScrollViewer is scrolled to the end in WPF?

可紊 提交于 2020-01-19 00:43:28
问题 I have a ScrollViewer instance in my custom control... I need the requirement that whether scorollview is scrolled to the End? Is there any way? 回答1: You can check this with this way: ... scrollViewer.ScrollChanged += OnScrollChanged; ... private void OnScrollChanged(object sender, ScrollChangedEventArgs e) { var scrollViewer = (ScrollViewer)sender; if (scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight) MessageBox.Show("This is the end"); } 回答2: Here is my MVVM-friendly version: