Page view counter
Moving Silverlight Object
Last post 08-18-2008 9:35 PM by lingbing. 3 replies.
Sort Posts:
08-06-2008 8:41 AM
Moving Silverlight Object

Hi, I have a problem:

My Silverlight Applicacion is in hidden div when start the browser application. And then i want change this <object> (Silverlight application), to other div, that are in other position in the DOM three.

 I tried to do with this code, and it works, but the problem is that don't move the original object, do a copy because the Silverlight application begin of start, and don't save the changes that i have realised in Silverlight application.

function ChageDiv()

{

var hiddenDiv= document.getElementById("hiddenDiv");

var appSilverlight = hiddenDiv.firstChild;

 

var otherDiv= document.getElementById("otherDiv");

 

otherDiv.appendChild(appSilverlight);

}

 

Any idea for moving with javascript nodes of type object holding the reference of memory?

 

Thanks.

quintorel

Loading...
Joined on 04-22-2008
Posts 14
08-13-2008 5:42 AM
Re: Moving Silverlight Object

I have an idea for your problem: you can use IsolatedStorage to save your silverlight application's state, and when the appliaction start, after InitializeComponent() in the ctor of Page class, you could load those states and init them to your controls.

Ling Bing
Bei Jing University of Aeronautics and Astronautics
Bei Jing, China

lingbing

Loading...
Joined on 07-16-2008
Beijing
Posts 251
08-18-2008 12:20 PM
Re: Re: Moving Silverlight Object

I like that idea of using IsolatedStorage to store a value to determine the position of the div. Also if they have to login to your site can you not store that data in a database....

the only problem with IS is that if they set it up to be in x position on their work pc and then go home and access it on there personal pc the IS vaule won't be there. As it is tied to the machine. Just worth a think :)

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Thanks

blog: www.silverlightblog.com

Muller2

Loading...
Joined on 01-07-2005
Posts 60
08-18-2008 9:35 PM
Re: Re: Moving Silverlight Object

That is really a problem, I think if you truely want to save your states and reuse it anywhere, one way is using DOM and call some method in an Asp.net page, so that you can access database to save it, and we you restart ths Silverlight application, you can use InitParameters to init anything you want to pass to the silverlight application from asp.net page.

Regards!

Ling Bing
Bei Jing University of Aeronautics and Astronautics
Bei Jing, China

lingbing

Loading...
Joined on 07-16-2008
Beijing
Posts 251
Microsoft Communities