The best coding practices for Silverlight Application Development

by
Hire Asp Developer | 09 Apr 2012
Silverlight Application Development is very much in demand. But one needs to follow certain rules while coding so that the standards are maintained and the overall coding remains uncluttered and well-arranged.
- Avoid using “xmlns” namespaces which are not necessary in the XAML file. Extra namespaces increases the load time of the Silverlight page.
- Avoiding addingthe same namespaces many times in a single page. It ruins the XAML code during maintenance and also causes loading problems and memory issues at runtime.
- Proper names should be used as “xmlns” namespace prefixes. Multiple declarations of namespaces can be avoided in future.
- Use “local Controls” or “local Converters” according to the namespace name. Proper prefix names are useful to distinguish in proper way.
- For adding controls without elements inside it, it is good to close usinga self-closing tag “/>” instead of using () for a better or cleaner XAML code.
- Unnecessary resource keys should not be used if not needed as that would increase memory usage and also cause some animation issues due to this.
- Avoid using extra panels unless it is needed.
- Use Grid as your panel first with a flexible UI layout during Silverlight Application Development
- Do not give names to every object you create as it object creation takes up extra space at the time of load.
- Use the Visibility property instead of Opacity property to hide content. The Visibility property collapses the control making spaces for other controls, while Opacity occupies space.
- Proper formatting of XAML code is useful and gives better look of code for maintenance.
- Use comments whenever required.
- Use Static Resource instead of Dynamic Resource for better performance and to throw exceptions for searching out root cause for bugs.
- Avoid styles & storyboard animations which are not required.
Hire Silverlight Developers in offshore locations for cost-effective services and efficient results. You can also get them to do ASP.NET Silverlight Development or even Silverlight for Desktop applications.