2 Replies - 800 Views - Last Post: 06 November 2012 - 11:58 PM Rate Topic: -----

#1 complete   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 113
  • Joined: 12-April 07

Why doesn't this call back function get called?

Posted 29 October 2012 - 07:59 PM

Why doesn't this call back function get called?

Basically here is the code surrounding the declaratoini callback method:

	webbrowser1 = new WebBrowser();

	webbrowser1.LoadCompleted +=webbrowser1_LoadCompleted;

	webbrowser1.Navigate(new Uri("http://www.google.com"));



Should there be something more or are they in the wrong order?
The method, webbrowser1_LoadCompleted, is never called. I have put breakpoints in the callback method and the running program never reaches this method:
         void webbrowser1_LoadCompleted(object sender, NavigationEventArgs e)
        {
            .
            .
            .

        }




Is This A Good Question/Topic? 0
  • +

Replies To: Why doesn't this call back function get called?

#2 janne_panne   User is offline

  • WinRT Dev
  • member icon

Reputation: 428
  • View blog
  • Posts: 1,047
  • Joined: 09-June 09

Re: Why doesn't this call back function get called?

Posted 30 October 2012 - 01:19 AM

LoadCompleted event doesn't seem to fire if the WebBrowser doesn't exist in visual tree. Could that be your problem?

If you just need to download the contents of a web page without displaying the page to the user, you can do that with WebClient or WebRequest/WebResponse.
Was This Post Helpful? 2
  • +
  • -

#3 complete   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 113
  • Joined: 12-April 07

Re: Why doesn't this call back function get called?

Posted 06 November 2012 - 11:58 PM

That worked, by adding the web browser class as a child of the clases in XAML, the code recognized the class like this: grd.Children.Add(webbrowser1); But now I have new problems which I will describe in a new discussion thread.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1