Archive for November, 2008

I stumbled upon this the other day, though in hindsight, it's obvious that it would be there. Just as with the hyperlinks in HTML, you can use the hyperlink in Silverlight to invoke the user's default mail client. This is commonly referred to as a "mailto" link.

To do it, just set the hyperlink's "NavigateUri" property to "mailto:" and add the email address. To add a subject, follow up the email address with a "?Subject=" and whatever you'd like the default subject to be. For example, the following code would open up the client's default email program with a mail to the address you fill in.

NavigateUri="mailto:NAME@DOMAIN.COM?Subject=Silverlight Hyperlink"

Very useful for sharing a site via a "Send to a friend" link or something similar. In that case, you would want to omit the "NAME@DOMAIN.COM" part shown above to allow the user to fill it in on their own.

Probably also very useful for "Contact Us" or "Send Feedback" links since the spambots probably can't see the content inside a Silverlight application.

In case anybody needs it, here's a Silverlight/XAML gauge object.

The downloadable project includes a single gauge object which is instanced twice so you can see how to change the color of the gradient background. My trial period for Design expired, so I did all of the design work in Blend. There's also a storyboard to "idle" and "rev" the needle in the gauge. If you elect to make your own animation or use code to animate the needle, remove the storyboard in there to crunch down the file size. I could also see this one potentially being used as a download graphic.

Here's what the project looks like:

Gauges Project










And you can see them live here. Enjoy.