Stringing Along to Disappointment in Silverlight


As I write more Silverlight code, I get more frustrated with its quirks.

I love that StringFormat is included in Binding.  However, what I don’t understand and what I don’t like is that StringFormat doesn’t seem to respect the CurrentCulture

Let’s say I have an app that’s tracking GiveCamp participation.  Let’s say that my foreign friends over in Europe organized a GiveCamp, to add an international factor.  Now let’s say that we’re tracking the number of devs working on projects each hour.  And let’s make a Silverlight app for that!

The daily chart may show the number of devs, broken by hour.  On the X axis, I’ll see time in my familiar “8:00 PM” format.  My foreign friends should see that same time as “20:00”.  I set the StringFormat property on my DateTimeAxisLabel (from the Silverlight Toolkit) and it works wonderfully.  

But let’s say I want to add a tooltip to each point to show the time (IndependentValue) and number of devs (DependentValue).  I toss a couple of TextBlocks in my ToolTip template, using StringFormat to format them.  These are the same format strings that I use on my axes, so they should respond similarly, right?  That’s what I would’ve expected.

But as I run my internationalized app, I see “8:00 PM” in my tooltips, and so do my foreign friends!  Wait… what?!?

Time to add code to get internationalization working properly, since WPF and Silverlight aren’t getting it right out of the box.

So here’s my call to the WPF/Silverlight teams – please, for the love of doing what’s right – have the StringFormat formatting default to the CurrentCulture rather than to its current default culture (en-US).  It only seems natural for an app to run on its CurrentCulture, unless the developer specifies otherwise.

The Microsoft response to this Connect ticket by closing it as “By Design” really disappoints me.  I can only hope that the Visual Studio team wakes up and realizes the importance of having WPF and Silverlight apps default to the CurrentCulture from an internationalization point of view.  This  “feature” of defaulting to “en-US” is more of a headache for those of us who do develop for an international audience and probably is just as much of a headache for my developer friends who aren’t in an en-US culture.

Just my 2 cents, from a frustrated Silverlight dev…


Books.. Check ‘Em Out!

Disclaimer: Although my work is related to the topic at hand, these are the thoughts of Sarah, the book junkie, and are not necessarily those of my employer.

Computerworld ran an article called “Beach Reads for Techies“, where execs talked of books they’re reading and books they’d recommend. I know some of you read something other than blogs… so I’m curious to see what others are reading. I’ll go first.

Currently reading: I’m recently finished “God’s Debris” by Scott Adams (recommended to me by Jeff). “The Religion War” – its sequel – just arrived from today.  

I had also recently finished some books by Malcolm Gladwell – specifically “Blink” and “Outliers“.

From the fictional side of things, I’ve finished a bunch of Janet Evanovich and James Patterson novels, looking forward to reading some Candace Bushnell stuff.

Text-delivery medium of choice: Ever since I got my Sony Reader Pocket Edition in February, it’s been more eBooks than dead-tree versions. Most of the books I check out are from my local libraries, but I also like getting the MEAP books from Manning.

Book(s) you’d most recommend to your blog readers: These books may not be technical, but they offer interesting perspectives on life and are written by characters who were key figures in my childhood. The titles I’m recommending – that I have on my bookshelf at work – are “It’s Not Easy Being Green And Other Things to Consider” by Jim Henson and “Seussisms” by Dr. Seuss.

Tag, You’re Up Next

I know you guys read, so let’s see what you’re reading now.