Custom Control Creation (or Why Silverlight Needs a Blink Control)

January 22, 2009
No Comments.

Silverlight Logo
The worst ideas seem to start up on Twitter.  Really I blame Frank LaVigne. There was a short discussion of comparison something to the Blink tag in HTML (e.g. they were trying to disparage it). Then Frank in his own brand of wisdom said that someone should build a Blink tag for Silverlight:

The last thing I needed today was a distraction from the ASP.NET MVC work i've been doing...but an hour down and I had a control that mostly worked.  I created the simple custom control so that users could specify a Text String, font properties, a blink interval and a blink color.  For example the control can be used like so:

<useless:Blink Text=“Am I Blinking?”

But then I figured this was a good example of any how to create a simple template-supported control (e.g. supports ControlTemplates) and dependency properties. I will leave the discussion of whether this is a good idea for a control to another blog, but if you want a quick example of a small custom control, grab the code and take a look.  I am open to any suggestions to put it up on CodePlex for the community to elaborate.  The code is here:


Copyright © Wilder Minds LLC 2007-2024