This is a mirror of official site: http://jasper-net.blogspot.com/

Getting the Silverlight Toolkit Controls to work on WP7

| Wednesday, August 11, 2010
As we get closer to the launch of WP7 (Windows Phone 7) more and more developers are starting to play around with the SDK and build out applications.  Since WP7 supports Silverlight 3+ (3+ means it is basically Silverlight 3 w/ some tweaks to work in a multi-touch environment) it is logical to think that you should be able to use the Silverlight Control Toolkit for Silverlight 3.

However if you simply take the binaries from the source on codeplex and try to use them with say the expander control you are going to get runtime errors.  The errors revolve around the GlobalCalendar, but they are very easy to fix (assuming you do not need the global calendar control).

What I did was open up the Silverlight.Controls.Toolkit.sln file (I happened to upgrade my sln to VS2010 but that is not needed) and do the following

Exclude the GlobalCalendar folder from Controls.Toolkilt
Open up the Themes/generic.xml file and comment out the various GlobalCalendar items (items under toolkit:GlobalCalendar) such as
<Style TargetType="toolkit:GlobalCalendar">
<Style TargetType="toolkitPrimitives:GlobalCalendarButton">
<Style TargetType="toolkitPrimitives:GlobalCalendarDayButton">
<Style TargetType="toolkitPrimitives:GlobalCalendarItem">
One you have these items removed simply recompile the source and use the new binaries which are generated.

Now of course this is the easy way out I could have spent the time needed to actually resolve the root cause, but I did not need the GlobalCalendar control at this point so I ‘hit the easy button’.  I am sure that someone else out there can resolve this w/out the need to remove items.

Read more: devlicio.us

Posted via email from .NET Info

0 comments: