Step 1 of 4: Setting up the Application

In this step you'll begin in Visual Studio to create a Windows Phone application using ContextMenu for Windows Phone. Complete the following steps:

1.   In Visual Studio, select File | New | Project to open the New Project dialog box.

2.   In the New Project dialog box, select a language in the left pane, and in the templates list select Windows Phone Application. Enter a Name for your project and click OK. The New Windows Phone Application dialog box will appear.

3.   Click OK to close the New Windows Phone Application dialog box and create your project.

4.   Right-click the project in the Solution Explorer and select Add Reference.

5.   In the Add Reference dialog box, locate and select the C1.Phone.dll assembly and select OK.

6.   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" xmlns:c1="clr-namespace:C1.Phone;assembly=C1.Phone" 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">

7.   In the XAML window of the project, place the cursor between the <Grid x:Name="ContentPanel"></Grid> tags and click once.

8.   Navigate to the Toolbox and double-click the C1ContextMenu icon to add the control to the grid. Create an opening and closing tag. The XAML markup should resemble the following:

 

<Grid x:Name="LayoutRoot">

<c1:C1ContextMenu>

</c1:C1ContextMenu>

 </Grid>

You have successfully created a Windows Phone application containing a C1ContextMenu control. In the next step, you will customize the control.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.