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
-
Related
Is there a way to move a popup to back, so it does not always display on the front of the application?
I have a canvas that displays many shapes, which are resizable. To get the resize box I am using a popup, because it was suggested that the best way would be to use adorners, but these are not used in UWP, so the alternative are popups. It works quite well, but when I have another element overlaying my canvas and resizing was enabled on a shape, the popup elements (resize thumbs/nodes) are displayed on top of the element that should be overlaying the canvas. Is there a way to tell the popup that it should not display on a "higher level" than my canvas?
A Popup control is intended to be displayed on top of all other content so it seems you're not using an appropriate control for what you are trying to achieve.
Without seeing more of your code and having a clearer idea of what you're doing (repro?) it's hard to suggest what you should do. However, I'd avoid resizing control that aren't on top of the viewable area or having multiple items in a resizable mode (or just with adorners displayed) at a time. Both of these should avoid what you're reporting.
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.
I ran into a little problem while writing Windows 8 application on C#+xaml. My app has one main page, which is divided in two parts – ListView as a navigation panel on the left, and Frame on the right. All of that looks and works a bit like PC Settings panel. But there is one difference – when page into frame has enough content and it’s scrollable, I perform animation of collapsing navigation panel to icons-only state (when in full width it has text and icons).
So, here is the problem. Let’s say I’m on the first page and panel is collapsed. Then I go to the second page, and I've got to return to full-width state of panel. But since I’m doing it at the same time as showing content in the frame, there is a little freeze of animation, and it's becoming really noticeable when GridView has got a lot of items. So animation freezes on a half way, then GridView render all items images, and then it continue.
Only way to fix this problem I come up with, is to do navigation after animation completed. It’s doesn’t look very pretty, so I go on a blank page first, perform animation, and then go on target page. But this solution still feels wrong, and there still some problems with animation after resume from suspending.
So, is there any way to ensure that rendering of GridView will not interfere with my animation?
Thank you, and sorry for my English.
You can set NavigationCacheMode on the pages to Required and navigate through all the pages to preload them while hiding the Frame using the Opacity property, but that will be slow the first time you do it. Try to limit the number of bitmap pixels you need to decode and render on each page too. If all else fails - see if the Preload() method of the AlternativeFrame control from WinRT XAML Toolkit might be of help.
I have a web view which loads html content in a page.How its back ground can set to transparent.I set the html background transparent.
Try this:
<WebView DefaultBackgroundColor="Transparent"/>
To my knowledge that's not possible since this an actual HTML page you are rendering inside the Webview.
The webview does not derive from Control and because of this, it does not support the same templating possibilities as if you we using a control that derived from Control.
Also since browsers can't have a transparent website, the website will appear white per default.
This may not directly relate to your question however I think it's still important to know when using the Webview. There is some important remarks from the documentation on MSDN concerning UI and rendering:
WebView has the characteristic that other UI regions such as controls cannot be rendered on top of the WebView. This is because of how window regions are handled internally, particularly how input events are processed and how the screen draws. If you want to render HTML content and also place other UI elements on top of that HTML content, you should use WebViewBrush as the render area. The WebView still provides the HTML source information, and you reference that WebView through the SourceName property. WebViewBrush does not have this overlay limitation.
If you want to display an interactive WebView that only occasionally has overlapping content (such as a drop-down list or app bar), you can temporarily hide the WebView control when necessary, replacing it with an element using a WebViewBrush fill. Then, when the overlapping content is no longer present, you can display the original WebView again. For more info, see the WebView control sample.
For more information see the full documentation.
They have fixed it in Windows Universal App.
If you set DefaultBackgroundColor to Transparent
and
body, html {
background:transparent;
}
you will get what you want
I've noticed that whenever you have a WebView on your screen, it will be the top-most element of the UI. Is there a way to set a z-index?
There is no way to set z-index or anything similar, WebView is always on top of the XAML ("Airspace" issue). You have to hide web view if new content completely hides WebView or use WebViewBrush control.
http://blogs.msdn.com/b/wsdevsol/archive/2012/10/18/nine-things-you-need-to-know-about-webview.aspx#AN2
http://blogs.msdn.com/b/priozersk/archive/2012/08/13/how-to-display-charms-on-a-top-of-the-webview.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webviewbrush.aspx
From https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webview.aspx:
Note The "airspace problem" has been fixed starting with Windows 8.1.