I couldn’t locate a Visual Studio project template for creating a windows phone 7 custom control library. So….I decided to make one. It is pretty straight-forward to create one by hand but the second time the process becomes a bit tedious..
Since it is practically the same as creating custom controls in wpf and silverlight it has been well documented. Here’s a clear and recent, phone-specific write-up http://www.windowsphonegeek.com/articles/7-Mistakes-Developer-make-when-implementing-Windows-Phone-Custom-Controls which points out some common errors.
Anyway, here’s the installation instructions:
- Find the folder used by visual studio for ‘user project templates location’ (Navigate to Tools > Options > Projects and Solutions and it will be in the right pane – see image below) and download and copy this zip file to that folder.
- Extract all files
(This should result in a further zip file called ‘WP7 Custom Control’ being extracted to a subfolder called ‘Silverlight For Windows Phone’).
Next time you open the create new project dialog there should be an entry for a ‘Windows Phone Custom Control Library’ as shown below:
which, when selected will result in a project structure illustrated below..
By the way, to create a project template simply create or locate a project to base the template on and select File > Export Template in Visual Studio. See http://msdn.microsoft.com/en-us/magazine/cc188697.aspx for further details.
Windows Live Tags: windows phone,wp7dev,custom control,template,Visual Studio,library,Developer,Windows,templates,Projects,Control
WordPress Tags: windows phone,wp7dev,custom control,template,Visual Studio,library,Developer,Windows,templates,Projects,Control