Posted 10 February 2010 Tweet
Here are a few of the Visual Studio C# code snippets that we use on the Silverlight team when building controls and apps.
Download a zip (7 KB) of them all and extract them into your Snippets folder, which is in your Documents folder: Documents\Visual Studio 2010\Code Snippets\Visual C#\My Code Snippets\. These also work with Visual Studio 2008.
Inside the code editor, start typing the name of the snippet (such as dp, for a standard dependency property declaration section with a change handler). You should see it in the Intellisense drop-down.
Press tab to accept the value.
If there are editing helpers for the snippet, use tab to move through the fields as you fill them out.
Press Enter when you are finished. This should drop you right into the triple-slash comment field to fill that out.
|dp||A standard dependency property with a property changed handler|
|dp_attached||An attached property declaration|
|dp_nohandler||A dependency property without a change handler|
|dp_value||A value type dependency property with change handler|
|dp_value_nohandler||A value type dependency property without a change handler|
|inot||An INotifyPropertyChanged implementation|
|test||A simple unit test method, descriptive comment, and description attribute|
|testa||An asynchronous unit test method|
Hope this helps.
Jeff Wilcox is a software development engineer at Microsoft who leads exciting open source projects on the Windows Azure team. Jeff has been at Microsoft 8 years and is an alumnus of the University of Michigan.
Jeff leads the open source Windows Azure SDK and cross-platform command line tools development team at Microsoft. Offering tooling for OS X, Windows and Linux and SDKs for Node.js, Java, .NET, PHP, Python; the work is open source, licensed under the Apache 2 license.
4th & Mayor is the top-rated social app on the Windows Phone Store with thousands of five star reviews. The best foursquare experience for Windows Phone, it is powered by a Node.js backend running on Windows Azure & Amazon Web Services. Jeff Wilcox is the developer of the app.