Wpf Modern Ui Not Responding message in window header issue? - wpf

In above image i am using Wpf ModernUi template, while form is not responding the UI changes like normal wpf window. If any one knows how to fix this kindly share.

Related

winform webbrowser display pdf in same window

I have a simple question which expects a simple answer! :-)
In a visual basic .NET winform I drop a WebBrowser control
Within the form's load event script I have this:
WebBrowser1.navigate("http://www.whateverWebsite.com/WhateverDocument.pdf")
Now the issue is that the webbrowser actually launches an Adobe reader new window with the PDF document, and that window is NOT part of my application.
In my application the WebBrowser control says: Navigation Cancelled!!!!
What I want is the pdf file displayed within the actual WebBrowser control.
Any fix greatly appreciated.
Isn't this a setting in Adobe reader? Look for Display PDF in browser in settings.

Silverlight App inside WPF WebBrowser?

I have a hopefully trivial question. Currently, my company works with a rather obscure language (SyngergyDE) and we need to call a SilverLight application inside our product. Unfortunately, this obscure 3rd party language only (currently) supports the opening of WPF screens. So with that said, I thought I'd develop a small WPF user control that contains a "WebBrowser" control and navigate to the silverlight application's URI. This works fine, and I'm able to see the SL application. Here is my question - we have a "Close" button on the SL application, and when users "Click" that button, we want the window to close.
Does anyone have any suggestions on how we can communicate the "Closing of the SL App" to the WPF user control, so that the entire WPF user control closes as well?
Thanks everyone,
-Tom
Attach an event handler to the WebBrowser.Navigated event.
Have the close button in the Silverlight application use:-
HtmlPage.Window.Navigate(new Uri("about:blank", UriKind.Absolute));
When the Navigated event fires in WPF with the url "about:blank" then its time to close the control.
Use Javascript and the HTML DOM as the glue here.
For example, when the SL app close button is clicked, have Silverlight trigger some Javascript code that sets a flag, or alternately, raises some HTML document event.
The WPF control could poll that flag in the HTML + Javascript, or alternately listen for that HTML document event, then close the user control.

How to prevent WebBrowser control from stealing focus from other text box in my WPF form

My WPF app has a window with various text boxes and a WebBrowser control.
The WebBrower control is used to show a web site (I doesn't own) and then a Login button in the WPF window fills the fields in the site from the text boxes.
The problem is that the web site calls focus() method on one of its input fields on load, and that still the focus from the text box in my WPF window. I want the focus to be on the WPF window field and not in the web page within the WebBrowser control.
I tryed calling MyTextBox.Focus() in the WebBrowser's LoadCompleted event, but to no avail. Setting the WebBrowser's IsEnabled or even Visibility properties didn't help either.
Does anyone have an idea how I can overcome this and move the focus to the WPF control instead of the web page input field?
Don't think you can extend the control site to add IProtectFocus to the site. Try interop the Windows Forms version of the webbrowser control and override the CreateWebBrowserSiteBase method to provide your own control site.

Can I embeded IE in my wpf application and interact with it firing events

Can I embeded IE in my wpf application and interact with it firing events?
e.g. can I fill a form and press submit button programmatically?
Below is the link to the web browser control for WPF, this control was not part of the initial release of WPF, and was added in 3.5 SP1. As long as you are targeting 3.5 SP1 you can use this control and interact with the content in it. I have a WPF application that does use this control and we do a lot of JavaScript interactivity with the content from the browser by drawing on a WPF canvas and sending that information to the content API of the web browser control.
If you need an example I can look up some code samples from the application and send them your way.

Stop Dragging from a WPF WebBrowser control

I have a WPF application which contains a WebBrowser control.
Currently, the user can select something within the WebBrowser and can copy the content by dragging it out to another application and dropping it there.
I'd like to be able to stop the user doing this. I'd assumed that there would be a "DragStart" event that I could capture and cancel - but I haven't been able to find something so simple.
Is it possible to capture the start of drag event and cancel it?
Is there a better way to achieve this?
You can implement IDocHostUIHandler::FilterDataObject and filter out common clipboard formats
You don't get access the WPF browser's native interface until the document is ready. Not sure if it would work with the WPF browser class. There is also a bug in Windows Forms to prevent you from customizing its implementation of IDocHostUIHandler.
You can try some wrapper class of the webbrowser ActiveX, such as the one described at http://www.codeproject.com/KB/miscctrl/csEXWB.aspx

Resources