var myControl = plugIn.content.createFromXaml(a.loader.GetResponseText(part), true);
myControl.findName('myStoryBoard').Begin();
parentCanvas.children.add(myControl);
On Silverlight 1, this code will result an (infamous) error: AG_E_RUNTIME_METHOD : Begin
The solution is simple, add the created object first to main object tree and then start the animation:
var myControl = plugIn.content.createFromXaml(a.loader.GetResponseText(part), true);
parentCanvas.children.add(myControl);
myControl.findName('myStoryBoard').Begin();
This is obvious when looking to simple code like this, but in a bigger application it might not look so.
It's 'interesting' that in Silverlight 2.0 this error does not appear.
No comments:
Post a Comment