I have a scrollviewer which has a gridview as content.
In the datatemplate of the grid view, there is a 2 column grid.
In the first column there is a flipview and in the second a webview.
One gridviewitem take all the screen. When I scroll, the webview make an effect. It's like the webview is not fixed and does not scroll at the same time as the other elements.
Do you know why? Can I remove this effect?
Thank you
(I develop in C#/XAML)
The WebView can be difficult to work. To solve your problem, take a look at the WebViewBrush to render the content of your WebView onto a Rectangle that will behave better. Use WebViewBrush when scrolling and also to prevent the WebView from remaining in the foreground when it is supposed to be covered by an overlay but the WebView remains at the highest position in the z-order.
Related
In default maps application there are control, that overflows other content on page. It's height can be changed by sliding up and sliding down this layout.
Is there way to implement that control?
P.S. sorry for my english
With a Grid or Canvas control you can overlay controls.
If you used a Grid control you would put all elements on the same Grid.Row but the order they appear in the XAML would determine their Z-Index. The control you want at the bottom could then be placed by setting the VerticalAlignment to Bottom.
I have a WebView that I want to fade in after loading the page, I've tested fading out/in other elements but this is not working with control. Is there any way to get this visual effect to work with WebView?
WebView is implemented in a different way from most of the other elements. It is drawn in its own window even though it is mixed with your other XAML elements.
That' means that you cant' do certain thing with WebView
No transparency (which means no fading either).
Can't overlay another element over the Webvew
-
I'm trying to recreate the layout of the Weather app in XAML / C#. I have a ListView full of ListViewItems. It is one of several objects within a ScrollViewer. The end result should be that the user can scroll horizontally through the Objects, but stop on the ListView and scroll vertically.
For the effect to work, the ScrollViewer must match the height of the page, and the ListView must match the height of the ScrollViewer, without stretching it.
I can't figure out how to do this without using code-behind to find the Window.Current.Bounds and apply the height to the ScrollViewer, this seems like a dirty hack. Is there a way to do this purely in XAML?
The ListView has its own scrollbar stuff, without needing a ScrollViewer. Otherwise to make things stretch it should be pretty easy - how are you putting things in the ScrollViewer? Through a Grid? A StackPanel?
This may be what you are looking for, but you may find it useful to achieve a 'weather app' look and feel:
http://dotnetbyexample.blogspot.co.uk/2012/08/a-winrt-behavior-to-turn-flipview-into.html
In the app preview for the Bing Weather app in the Windows 8 release preview, the title text changes automatically when the "view" changes (i.e. when scrolling).
My app currently has two ListBox items inside a Grid item, wrapped with a ScrollViewer element. I want the title to change according to which of the ListBoxes is currently in view.
Suggestions of different UI elements or layouts are also welcome
What if you try to use Height properties of ListBoxes and ScrollViewer?
I mean you know the height of ScrollViewer. So after scrolling you need to check if ScrollViewer's offset (e.g. VerticalOffset) is more than Height (or maybe ActualHeight, it depends on your markup) of, let's say, 1st ListBox.
That way you will know if 1st ListBox is not visible, so the 2nd ListBox is in scope and you can change Title.
I hope my point is clear for you.
I have an application that displays wrapped text in a ScrollViewer that takes up a fixed height of the page. I set the HorizontalScrollBarVisibility to Disabled, and the VerticalScrollBarVisibility to Auto.
The usability problems I'm having are as follows:
Despite being set to Auto, if the content is smaller than the ScrollViewer, then the content can still scroll up and down, either scrolling past the end or hiding a portion of the text. I would like the ScrollViewer not to allow scrolling when the entire content fits inside its bounds. At the very least it should always snap the content back into view when you over-scroll.
Secondly, when the content does scroll, it sometimes gets stuck past the end and won't "snap back" from the over-scroll. For example, if the content fits fully in the ScrollViewer, and you drag your finger up or down on the text, the text will be obscured by the top or bottom of the ScrollViewer, and won't snap back. If however you drag your finger up starting from outside of the content of the ScrollViewer, it will snap back when you scroll past either end. I would like the "snap back" behavior to happen whether you drag on the content or outside of the content. Is that possible?
First issue: If your content isn't large enough to warrant the need for a scroll viewer don't put it in one. If the size of the content changes only enable the scrollbar when the volume of content warrants it.
Can you provide a way of reproducing the second issue.