This topic details how you can add the Studio for Windows Phone components to the Toolbox, add controls to a project, and to add references to the Studio for Windows Phone assemblies. When the Studio for Windows Phone controls are in the Visual Studio Toolbox, you can easily add them to a project at design time.
Manually Adding Studio for Windows Phone Controls to the Toolbox
To add the ComponentOne Studio for Windows Phone controls to the Toolbox, complete the following steps:
1. Open the Visual Studio IDE (Microsoft Development Environment). Make sure the Toolbox is visible (select Toolbox in the View menu, if necessary) and right-click the Toolbox to open its context menu.
2. To make Studio for Windows Phone components appear on their own tab in the Toolbox, select Add Tab from the context menu and type in the tab name, C1Phone, for example.
3. Select File | New | Project to open the New Project dialog box in Visual Studio 2010.
4. In the Project types pane, expand the Visual Basic or Visual C# node and select Silverlight for Windows Phone.
5. Right-click the tab where the component is to appear and select Choose Items from the context menu.
6. The Choose Toolbox Items dialog box opens.
7. In the dialog box, select the Windows Phone Components tab. Sort the list by Namespace (click the Namespace column header) and check the check boxes for all components belonging to the C1.Phone, C1.Phone.Chart, and C1.Phone.Extended namespaces. Note that there may be more than one component for each namespace.
8. Name the project, specify a location for the project, and click OK.
A new project will be created with the name you specified.
Adding Studio for Windows Phone Controls to the Application
To add ComponentOne Studio for Windows Phone controls to the application, complete the following steps:
1. Add controls to the Visual Studio Toolbox.
2. Double-click a control or drag it onto your form.
Adding Assembly References in Code
To add a reference to the ComponentOne Studio for Windows Phone assemblies, complete the following steps:
3. Select the Add Reference option from the Project menu of your project.
4. Select the ComponentOne Studio for Windows Phone assemblies from the list on the .NET tab or browse to find the C1.Phone.dll, C1.Phone.Chart.dll, and C1.Phone.Extended.dll files and click OK.
5. Select View | Code to open Code View. At the top of the file, add the following Imports statements (using in C#):
Imports C1.Phone
Imports C1.Phone.Chart
Imports C1.Phone.Extended
Adding XAML References
To add a XAML reference to the ComponentOne Studio for Windows Phone assemblies, complete the following steps:
1. Add the XAML namespace to the <phone:PhoneApplicationPage> tag by adding xmlns:c1="clr-namespace:C1.Phone;assembly=C1.Phone" so it appears similar to the following:
<phone:PhoneApplicationPage x:Class="C1WP7.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" shell:SystemTray.IsVisible="True">