Saturday, 21 June 2008

Silverlight 2 Styles Designer Bug

I'm sure loads have people have seen this already.

I have a silverlight usercontrol (mysilverlightpage.xaml), which contains a silverlight usercontrol (mylefthandnav.xaml).  If both usercontrols use a global style (defined in my app.xaml), the designer blows up in the container page (mysilverlightpage.xaml), but is ok in the contained control (mylefthandnav.xaml).

The application however runs fine.  If I however remove the style from my application resources (app.xaml), and have a local version of the style in each user control, then all is fine.

Friday, 20 June 2008

Listbox - SelectionMode

One of the features I am missing at the moment from Silverlight 2 is SelectionMode=”Multiple” for Listboxes.

This is a feature that they don’t plan to support at the moment. I can’t really argue with features being cut. It’s about trying to get out as much as possible as soon as possible.

From delay’s blog.

“Why is SelectionMode.Single the only supported SelectionMode? The Silverlight controls are subsets of their WPF counterparts in order to keep complexity and download size as low as possible. In cases where it seemed that specific functionality was not widely used, we opted to exclude it for Beta 1 and use customer feedback to identify which missing features are the most important. SelectionMode.Multiple and SelectionMode.Extended both fall into the category of "very nice to have, but seemingly not critical for most scenarios" - if you need multiple selection support, please let us know!”

However I have to disagree, if you speak to many developers regarding Silverlight 2, the most missing requested control is the ComboBox. I have no doubt that when the combobox is made available, for single selects most people will use the combobox has the control of choice.

So where does this leave the listbox, the most common scenario for a listbox (from my own experience) is for doing multiple selects. So therefore i believe this feature is important as it’s difficult to do this without it. Leaving the only real solution is to use the Html Bridge, use a third party control, or write your own control.

To the extent that I have decided to use XBAP for a feature I am developing at the moment (in which I would prefer to use Silverlight 2)

Friday, 13 June 2008

Fest08 – What a blast

I was at the superb NxtGenUG Fest08 yesterday. I have to say this was one of the best conferences I’ve been too.

Session Highlights:

Oliver Sturm – F# – Superb overview of F# (something that i play with in my spare time occasionally)

Josh Twist’s Expression Blend Demo – best designer demo I’ve seen from a developer.

Who’s Session is it anyway – another NxtGen gameshow. What a hoot!

Day Highlights

Although coordinators can’t win prizes (I’m one of the Cambridge region coordinators). My nugget in Birmingham was top rated nugget for the year, My nugget in Coventry was rated 2nd top nugget. And my session with Richie Costall was rated 2nd best session in Cambridge (Daniel Moth was first).

It was also great to see Daniel Moth do his swansong nugget before he heads to Redmond.

I was asked very last minute to do a grok talk (which seemed to go down very well).

Big Thanks to Rich, Dave and John for putting together a brilliant day.

Tuesday, 3 June 2008

Silverlight Beta 2 - This Week

Silverlight Beta 2 is available this week with a commercial Go Live Licence.

New version of Blend 2.5 and Microsoft Silverlight Tools Beta 2 for Visual Studio 2008.

Yaaaaay

WCF Hosts. Ports and Namespaces

If you have one Windows Service host which hosts multiple WCF Services, you can reuse the same port for multiple endpoints.

If you use host the endpoints in different Windows Service Hosts then you can't share port. This is because the host is responsible for the port.

SQL Reuse

One of my goals for this year is to advance my SQL knowledge.

The real way of doing this is to constantly ask questions of how you do things. I am very lucky as I work beside some really top SQL bods, who i like to bounce different ideas with.

The one thing I think you need to keep in mind is the difference between a SQL developers mentality and a C# developers mentality (the camp i sit in).

Since there are many solutions too different problems, I like to try and work out the best solution (sometimes I see it, sometimes I don't), in yesterdays case I didn't. Thanks to Nick for helping me out on this one.

I had an existing stored proc, which parsed the syscomments table to work out the default parameter for a specified stored procedure. I wanted to ramp this up so i could get the default parameter for all stored procedures. Now this is a batch job, so performance is less of an issue but nonetheless I wanted production level code (with the best performance).

I saw two solutions to this problem:

1) Convert my stored proc to a UDF and then perform the calc for each stored proc as part of a join with sys.objects and sys.parameters
2) Get all the stored procs + parameters stored in a temp table, and then loop over the table, calling my default parameter stored proc.

I thought like a C# developer (caring more about reuse), rather than a SQL developer.

The real solution was to analyse the stored procedure to see what it was doing rather than just trying to reuse it out of the box. This led me to solution 3 :

3) Join to syscomments with my stored proc, and use a UDF to perform the string manipulation to retrieve the default parameter (passing the stored proc text into the UDF), rather than allowing the UDF (per solution 1) to make the call to the syscomments table.

I feel my quest has taken a great leap forward today :)

Monday, 2 June 2008

NxtGenUG Fest08

FEST08 the annual NxtGenUG one-day event takes place at Microsoft Reading on Thursday 12th June. As ever it's going to be an action packed day with great content from the likes of Mike Taulty ,Oliver Sturm , Dave Sussman and other top speakers. No doubt there will be bundles of 'swag' and prizes and Pizza somewhere down the line - there always is when the nxtGenUG Boyz are around. There seems to be a few more of them this year with the Cambridge and Southampton crews joining in the mix.

So go to http://www.nxtgenug.net/fest08/ for details and to register your place. It's free to all NxtGenUG members and a mere £49.99 to non-members - bargain! Oh and also if you're around the night before there is a G(r)eek dinner to toast Daniel Moth on his way to the states. http://www.nxtgenug.net/ViewEvent.aspx?EventID=140 is the link to signup to.