Variable height
Silverlight is a great technique but it also gives me a lot of painfull thoughs. The first big thing I run into was the variable height of the Silverlight canvas. In the design of the homepage the Silverlight canvas can be very small say 200 px height. On the second page (projectdetails) the images are bigger and with the variable textblocks the height can be vary from 500px to 600px. I don't know why, there are 100% height and width options, the content in the canvas moves related to each other but the canvas size doesn't change.
For example: if you set the height of the canvas to auto, the content inside the canvas has a total height of 300px the canvas remain 300px. When you navigate to the next page 'a new frame is loaded', the canvas stays 300px height. There are complicated javascript and silverlight functions available to solve this problem, but these don't work in each browser.
The problem here is not particular the silverlight canvas, but its caused by a combination of the object tag and the silverlighthostcontroller (div where the object is loaded in). There are solutions available to set the silverlight canvas full height and width, but then you have to create your whole page in silverlight. In my case where the silverlight object is hosted in one page within the master design this is not the required solution.
I overcome this problem by using the maximum height I need, so 600px and fill up the white space with some other silverlight design.
Issue (note that this is not only in Firefox but also in IE8):
http://forums.silverlight.net/forums/t/5623.aspx
Load async XML
The next issue to overcome is the location of the xmldata file. The xmldata was part of the silverlight project instead of the webproject. In this way the file will be compiled into the XAP package. Without recompiling there is no way to add new projects to the XML file which is not required. The way to overcome this is to dynamicly add the xmllocation using asycromic download within the code.
http://www.kirupa.com/blend_silverlight/loading_xml_sl2_pg1.htm
Subscribe to:
Post Comments (Atom)
your Load async XML information is very helpful
ReplyDeletethanks
my blog:http://kai4dmt.wordpress.com