Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser StopLoad method and Url binding WPF Options
Alex
Posted: Tuesday, July 22, 2014 8:48:21 AM
Rank: Newbie
Groups: Member

Joined: 7/22/2014
Posts: 9
We are using trial version to know if the browser meets the requirements we need. If it will be so - we will buy your licence. But we reached with some issues.

The first is when we invoke StopLoad method during the page is loading - the view becomes white and there are message "The request was canceled.". It is not we expected to see. Are there any versions which have another behavior? We thought the page should just stop load and leave loaded view. It there any way to not show this error on page?

Another issue is that we can't bind Url to a property in WPF. Are there any workarounds which allows us to bind URL of control?

eo_support
Posted: Tuesday, July 22, 2014 9:22:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

In order to avoid showing "the request was canceled" message, you can handle the WebView's LoadFailed event, then set the event argument's ErrorMessage property to null inside your event handler.

WebView.Url is a standard CLR property. So it should work fine with WPF data binding. There might be some other issues that caused it not to work, for example, the WebView has not been created yet when the binding updates the Url property. If that's the case, you will need to address those issues.

Alternatively, you can wrap WebView up with your own object that derives from DependencyObject and exposes properties on your class that will set/get the corresponding WebView's property, then you will bind to your wrapper class's property. This way not only it's more "WPF friendly", but also allow you to debug since you can now set break point inside your wrapper class to see exactly what's going on. Our TabbedBrowser sample uses this technique, you can take a look of the source code in WebViewItem.cs/WebViewItem.vb to see how it works.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Alex
Posted: Tuesday, July 22, 2014 11:35:11 AM
Rank: Newbie
Groups: Member

Joined: 7/22/2014
Posts: 9
Thanks a lot, it helped. We have another little question. Could ZIndex be set on WebControl element? Seems now it is always on top. I mean that we need to show other element in front of WebControl. Can we do this?
eo_support
Posted: Tuesday, July 22, 2014 12:13:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

You won't be able to have anything over the WebView since WebView has its own window handle and all other WPF controls are windowless thus rendered inside the parent window, because parent window contents can never render over the child window, other controls can not render over the WebView. This is a known problem with WPF (not being able to render over windowed control). You may be able to find multiple unofficial methods online about how to get around this problem, but we would not recommend/endorse any since all of them involved some kind of "hacks" that can also cause other problems. If this is a serious issue for you, you may want to consider using Windows Forms instead of WPF. In Windows Forms the controls have their own window handle so it can handle zIndex/overlap fine.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.