scrollviewer

ItemsControl, VirtualizingStackPanel and ScrollViewer height

守給你的承諾、 提交于 2019-12-05 02:52:21
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.Template> <ControlTemplate> <StackPanel> <StackPanel> <TextBlock Text="this is a title" FontSize="15" />

Correct way to set ScrollViewer (for vertical scrolling) on a WPF Frame?

房东的猫 提交于 2019-12-05 00:19:45
does anyone know the difference between defining a vertical scrollbar on a frame like this: <ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto"> <Frame Name="Frame1" ScrollViewer.CanContentScroll="True" /> </ScrollViewer> or like this: <ScrollViewer Grid.Row="2"> <Frame Name="Frame1" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="True" /> </ScrollViewer> This frame is nested in a WebBrowser control and setting it the first way correctly displays the vertical scrollbar and is only visible when it needs to scroll (auto). When I set it the second way the

How to link scrollbar and scrollviewer

不羁的心 提交于 2019-12-04 23:23:08
问题 I currently have two ScrollViewer's containing alternate views of the same collection. I have bound the scrolling of the two scrollviewers together by handling the ScrollChanged event and using ScrollToVerticalOffset. For presentation reasons I have set both ScrollViewer scrollbars to hidden and want to control them both from a seperate ScrollBar. This seems to not be straightforward. I recall seeing a blog about it a few months ago but I can't find it again. Can anyone point me in the

WPF detect scrolling parent Control

只谈情不闲聊 提交于 2019-12-04 19:19:22
问题 Imagine the situation you open a WPF Popup (e.g. through ButtonClick ). You have a ListBox directly in the Popup with some items, so you have to be able to scroll. Imagine that this is your Custom Control and it's located in the ScrollViewer . Now if you move with your mouse outside from the Popup surface and scroll, what happens? You scroll up and down but with the Popup opened ! And that's the problem. The question is, how to detect from inside the Control, that some other unknown Parent

Touch Scrolling ScrollViewer in WPF App with RealTimeStylus Disabled

女生的网名这么多〃 提交于 2019-12-04 15:25:51
问题 We are working on a WPF 4.5 application that will be run on Windows 8 computers with touchscreen monitors. We have disabled support for the RealTimeStylus following the directions on the MSDN, since we have some views that need multitouch support through WM_TOUCH. The problem is that disabling the RealTimeStylus support seems to also disable the user's ability to scroll a ScrollViewer using touch - normally the user can pan around ScrollViewers with their fingers, but if RealTimeStylus

How can make ScrollViewer scroll when mouse is over *any* content

て烟熏妆下的殇ゞ 提交于 2019-12-04 06:46:41
The reason I stress 'any' is because CanContentScroll is not fully working in my ScollViewer . Let me explain the scenario: I have a ScrollViewer that has three Labels followed by a ListBox each. The reason I have this content inside the ScrollViewer is because I don't want each ListBox to have a ScrollBar , I just want one "global" ScrollBar . The problem is that when the cursor is over the the ListBox the ScrollViewer doesn't scroll. I've tried to set CanContentScroll property to true in the ScrollViewer, the ListBox and on the ListBoxItem style, without success. Is there other Control type

XAML: make a ScrollViewer show scrollbars when the ScaleTransform of a child object gets big

空扰寡人 提交于 2019-12-04 05:32:47
I am making a sort of "print preview" control for some documents in my Silverlight 3 application. I have a Canvas (for showing the document) inside of a ScrollViewer, and I have zoom in / zoom out buttons that control the X and Y Scale properties of the ScaleTransform for the Canvas.RenderTransform property. I want the scrollbars of the ScrollViewer to show up when I "zoom in" enough such that the canvas is no longer visible in the ScrollViewer area, but it seems that they only show up depending on the Width/Height of the Canvas itself, regardless of whether it is zoomed in or not. Can anyone

VirtualizingStackPanel stops working when overriding the default control template for ScrollViewer

女生的网名这么多〃 提交于 2019-12-04 04:52:45
问题 I have a listbox with a lot of items which are expensive to render. However the VirtualizingStackPanel takes care of that by only rendering the visible items. I want to override the control template for ScrollViewer since the default one has grey rectangle between the horizontal and vertical scrollbar. I just copied the one provided by Microsoft (ScrollViewer ControlTemplate Example) which do not have the grey rectangle issue. This controltemplate however disables virtualization by giving the

Putting ListBox in ScrollViewer: mouse wheel does not work

回眸只為那壹抹淺笑 提交于 2019-12-04 04:06:24
My mouse wheel does not work when putting a ListBox in a ScrollViewer . Does the ListBox somehow "steal" this event? <ScrollViewer VerticalScrollBarVisibility="Auto" Style="{StaticResource myStyle}"> <ListBox> <ListBoxItem>Test 1</ListBoxItem> <ListBoxItem>Test 2</ListBoxItem> <ListBoxItem>Test 3</ListBoxItem> <ListBoxItem>Test 4</ListBoxItem> <ListBoxItem>Test 5</ListBoxItem> <ListBoxItem>Test 6</ListBoxItem> <ListBoxItem>Test 7</ListBoxItem> </ListBox> </ScrollViewer> Edit: as requested by Joel, added the reason why I did this.. I did this because I don't like what the ListBox 's internal

Silverlight - DataGrid in Scrollviewer, Column.Width=“*” makes datagrid take several screen-widths

孤街浪徒 提交于 2019-12-04 03:58:30
问题 When I have the following setup, the last column having a width of * causes the datagrid to create huge horizontal scrollbars (extends grid to several widths of the screen). I'm not really sure why this is, but I really need a way to avoid that. I don't want to have to "simulate" column's with * lengths. edit: Apparently I'm not the only one who noticed this. http://connect.microsoft.com/VisualStudio/feedback/details/559644/silverlight-4-datagrid-star-column-width Xaml: <ScrollViewer Padding=