I really like Silverlight 4, and in the last months I ‘ve developed a Silverlight App which communicates with WCF which by the way talks to Sharepoint 2010 and Sql Server 2008R2. Well, with all this complexity, as you may guess I had to learn a lot about handlind strange bugs and problems…
Below, some of them with my solutions… a few more in later posts.
Stackpanel & Grid
You have a Grid with scrollbars, but they don’t show when data reach the bottom of the window or panel.
If you have a Grid inside a Stackpanel, see a way to remove the Stackpanel. You can use a DockPanel for instance.
AutoCompleteBox & Popup Window
When you use a AutoCompleteBox the dropdown window appears on the upper left corner of your popup window.
See if you are using Effects and remove them. It’s a well know bug… maybe at this time its fixed… or not..
ChildWindow and DialogResult
You want to call a ChildWindow as a DialogBox and collect the final DialogResult.
It will not work, because Silverlight uses an Async model. You need to create a delegate (which will point to a “local” method that will handle the result), pass it on the constructor and inside the childwindow, when you are ready to exit, call the “delegate” method and then exit.
PS: If you need an example give me a call…
You will have some forms and communications to outside Silverlight, for instance WCF.
Please use, MVVM or similar pattern, you will need if your Silverlight app grows. I had to refactor my app, because I didn’t follow this pattern from the beginning.
You can find more about this pattern here:
- For WPF but you can use in Silverlight as well
- Getting Started with the MVVM Pattern in Silverlight Applications