Microsoft has posted the source code and unit tests for many of their Silverlight Controls on the Microsoft Download Center. From the download page:
Brief Description
This download contains the source code and unit tests for the managed Silverlight 2 controls included in System.Windows.dll, System.Windows.Controls.dll, and System.Windows.Controls.Data.dll.
Quick Details
File Name: Silverlight 2 Control Sample Source Code and Apps.exe Version: 2 Date Published: 1/7/2009 Language: English Download Size: 881 KB Estimated Download Time: 2 min 56K
The source code for the Silverlight 2 controls includes implementations for the following controls:
- ButtonBase
- Button
- HyperlinkButton
- CheckBox
- RadioButton
- CheckBox
- ToogleButton
- RepeatButton
- RangeBase
- Slider
- ScrollBar
- ProgressBar
- Calendar
- DataGrid
- DatePicker
- GridSplitter
- TabControl
You will need need the “Microsoft® Silverlight™ Tools for Visual Studio 2008 SP1” installed to open to projects and code included in the download.
Many thanks to Greg at Greg’s Cool [Insert Clever Name] of the Day blog for discovering this.