Please visit http://www.ningzhang.org!

This is a backup site. Please go to http://www.ningzhang.org for the latest content and best viewing. Thanks!

http://www.ningzhang.org

Wednesday, November 19, 2008

Customize Silverlight Toolkit Controls: NumericUpDown

Introduction

The beauty of WPF/Silverlight control architecture is the separation of behavior from presentation, in another word, the capability to style/template a control so that it may look very different but still behave the same, more or less, all without a single line of code. There is no way a control's default UI can satisfy all possible user needs, so this capability is extremely useful, and there have been asks in the forum and from search queries to my blog for various customization of the default control templates in Silverlight Toolkit. It is actually fairly easy to re-templating/style a control with tools like Expression Blend. For your convenience, I will write a series of posts to demonstrate the most asked customizations, and provide the xaml that you can copy and paste for your own use. I will start with NumericUpDown.

NumericUpDown Customization

Below screen shot shows common customizations for NumericUpDown control. If you have Silverlight 2.0 RTM installed, you can also play with it here.

NumericUpDown Customization

Source Code

You can download the zipped project below to play with. I will add those customized templates to Silverlight Toolkit sample project in next release.  

Conclusion

Hope this is helpful! As always, feedback is welcome. Thanks!

2 comments:

Anonymous said...

Hi Ning Zhang,

Your source code appears to be truncated.

Any way to fix it (or add a ZIP file)?

Thanks,
Martin

Ning Zhang said...

Hi Martin,

Sorry for the source code truncation: it seems the "Insert Source Code" plugin I used has a limit on how much code it can take. Thanks for pointing this out. I've fixed it in the post; and per your request, attached the project zip file as well.

Thanks,

-Ning

Post a Comment

Please visit http://www.ningzhang.org!

This is a backup site. Please go to http://www.ningzhang.org for the latest content and best viewing. Thanks!