Loaded Event Not Firing When Using XamlReader

    General discussion

  • I am attempting to load a Canvas via the XamlReader.Load method.  While the object is returned, the UIElement.Loaded property is NOT fired, so the Canvas and several of its child controls that rely on that event are not fully initialized.  When I load a Canvas in Javascript via the Sys.Silverlight.createObjectEx method, the Loaded event does properly fire.


    Any thoughts?

    Thursday, June 21, 2007 1:09 PM

All replies

  • hello.

    how are you loading it?

    Thursday, June 21, 2007 4:30 PM
  • I think loaded event is fired when the object is actually inserted in the tree. did you try inserting the object that you get into the tree?

    Friday, June 22, 2007 2:57 AM
  • Thanks for the feedback.  You are right, Vivek.  On the first time a control is added to the active canvas, the OnLoaded event is fired.  Forgive my stupidity.  I just figured the "Load" method should fire the OnLoaded event.  :)


    Friday, June 22, 2007 7:30 AM