xml syntax highlighting in Silverlight

Several years back I posted a XML tokenizer for syntax highlighting. At the time I didn’t post a complete app, since it was part of a larger project; if someone recently asked me for a little more context for the tokenizer so I put together a quickie Silverlight project showing how to use the tokenizer…


Subclassing Shape (or more accurately, Path)

One of the more subtle improvements in Silverlight 4 is that we unsealed the Path class. That means you can write a class that behaves like a shape without re-implementing properties like Fill, Stroke, etc. — just subclass, set Path.Data to render what you want, and provide Measure/Arrange appropriate functionality. (Existing Shapes don’t all use…


Silverlight 4 Security Overview White Paper

[Update: This paper has been updated and published as the Silverlight Security Overview. -Nick] Wanted to let folks know about a white paper we’re making available (attached below). We plan to incorporate this into the main Silverlight documentation by the time we ship the Silverlight 4, but in the meantime I didn’t want to keep this…


Bulk check-in for SharePoint

This has absolutely nothing to do with Silverlight or WPF, but thought people might find it useful anyway. If you’ve ever tried to check in a large number of files into SharePoint, you’ll notice that there isn’t a way to check them in bulk — you have to check them in one at a time,…


VB item template for Silverlight Resource Dictionary

Here’s the VB version of the resource dictionary item template.  Copy the attachment into “C:\Users\<your name>\Documents\Visual Studio 2008\Templates\ItemTemplates\Visual Basic” . SilverlightResourceDictionaryVB.zip


VS item templates for Silverlight Resource Dictionaries

To make it easier to create merged resource dictionaries in Silverlight 3 beta, I put together a little Visual Studio item template so you can do “Add | New item… | Silverlight Resource Dictionary”. For C# users, take the attachment & copy it into “C:\Users\<your name>\Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C#” .  Look for the template at…


ChangeableObject and ValueConverter: databinding conveniences

A couple more bits of code that others might find useful…  Whenever I do databinding-intensive apps (both Silverlight & WPF), I find myself writing a fair amount of boilerplate code.  If you want change notifications on your class, you need to inherit from INotifyPropertyChanged, define a PropertyChanged event, and write a couple lines of code…


Why is the Silverlight Key enum missing common characters like comma and period?

Short version is, the keys we left out are harder than you might think to support, and they weren’t necessary for the scenarios we focused on (tabbing around forms, writing common controls, accelerated keys, etc.).   The longer version requires a little background on how keyboards differ across various languages, especially on Mac. Different languages…


Command helper classes for Silverlight & WPF

Here’s a couple classes I’ve found helpful when writing WPF & Silverlight applications, which I’ve named simply Command and CommandHelper.  Sometimes, you just want to do simple commanding stuff, and you don’t need the overhead of RoutedCommand.  (Also, Silverlight doesn’t have RoutedCommand)  The Command class below gives you a quick & easy way to define…