Silverlight for Windows Phone toolkit in depth (2)

Source: Internet
Author: User

Previous Article: Silverlight for Windows Phone Tookit in depth (1)

 

What else do I need?

Before using the Windows Phone toolkit, you must install the following tools:

    • Windows Phone Developer Tools
    • Visual Basic/vB tools download

 

Start Silverlight for Windows Phone Toolkit

To start your Silverlight for Windows Phone toolkit journey, visit

Http://silverlight.codeplex.com/releases/view/71550 (the latest official version is Silverlight for Windows Phone toolkit-August 2011 (7.1 SDK )).

There are the following methods:

    1. Install Silverlight for Windows Phone toolkit-Aug 2011.msi
    2. Download complete. ZIP FormatSource code(Silverlight for Windows Phone toolkit Source & sample-Aug 2011.zip)
    3. Download only xap files (Silverlight for Windows Phone toolkit sample application-Aug 2011.xap)
    4. Install Silverlight for Windows Phone toolkit using nuget

Method 1: Install Windows Phone toolkit. MSI

If you choose this method, first download the. MSI file and install it:

Step 1: Download Silverlight for Windows Phone toolkit-Aug 2011.msi

Step 2: Click Run to install

Step 3: Select "agree" and click Install

Step 4: After Windows Phone toolkit is installed successfully, you will find the "aug11" folder in the following directory

In the aug11 folder, you will find the following files:

1.-You can obtain more API information for this file.

2. include Microsoft Public License (MS-PL) Protocol

3. contains all the Assembly

Method 2: Download "Silverlight for Windows Phone toolkit Source & sample-Aug 2011.zip"

If you do not want to install the. MSI file, you can download "Silverlight for Windows Phone toolkit Source & sample-Aug 2011.zip", which contains a sample project and allProgramSet

Step 1: Download Silverlight for Windows Phone toolkit Source & sample-Aug 2011.zip

Step 2: Decompress the file

Step 3: you will find all the sources of the Windows Phone toolkit and sample projectsCode

Step 4: Open Microsoft. phonetoolkit. sln

Then you can compile the "Microsoft. Phone. Controls. toolkit" Class Library Project and get the generated assembly in the "bin" directory.

Method 3: Download only xap files

Another option is download: Silverlight for Windows Phone toolkit sample application-Aug 2011.xap

Method 4: Install Windows Phone toolkit through nuget

Nuget is an extension tool of Visual Studio. It can easily install and manage libraries and tools in Visual Studio projects. When you use nuget to install packages, it will automatically copy the required class library file to your project and automatically update your project (Add references, modify configuration files, and so on ). If you remove the installation package, nuget rolls back the changes to avoid unnecessary errors.

Windows Phone toolkit Aug 2011 (SDK 7.1) on nuget:

Http://nuget.org/List/Packages/SilverlightToolkitWP

 

How to use informal versions

Like all open-source projects released on codeplex, Silverlight for Windows Phone toolkit also regularly releases updates in two ways:

    • Official version: This is a stable version officially released. It is recommended to be used in application development through comprehensive and careful tests.
    • Informal version: Informal release version, which usually contains a small number of bug fixes and new features. It is not recommended to use a non-official version in the project unless there are no other solutions.

Here is how to use the informal update address:

Step 1: Access source code (http://silverlight.codeplex.com/SourceControl/list/changesets ),

Select the desired version as shown in the following figure:

Step 2: Click View diff to view all the changes made in the previous update, or click Download to download

Step 3: Download the selected update:

Step 4: After decompression, you will find all the source code and a sample project. To obtain the updated assembly, open the Aug 2011 source and samples folder, open the solution, and re-compile Microsoft. phone. controls. toolkit Project

After compilation, a new "bin" Directory will be generated.

You can obtain the Microsoft. Phone. Controls. toolkit. dll assembly.

 

How to use Windows Phone toolkit in Visual Studio

The most common method is to add reference to "Microsoft. phone. controls. toolkit. use the Silverlight for Windows Phone toolkit control and help class .. The basic steps are as follows:

Step 1: Create a Windows Phone 7.1 application project in Visual Studio

Step 2: Find "Reference" and select "add reference"

Step 3: Select "Microsoft. Phone. Controls. toolkit. dll". If you have installed the MSI file, you can find the assembly in the path below.

Or, you downloaded "Silverlight for Windows Phone toolkit Source & sample-Aug 2011.zip" and directly downloaded it from "... in the \ Silverlight for Windows Phone toolkit Source & sample-Aug 2011 \ windowsphone7 \ bin \ directory, select:

Step 4: switch to the XAML section of your application page and register the "toolkit" namespace. Then you can add the required controls:

 

How to integrate Windows Phone toolkit controls into Visual Studio toolbox

Visual Studio toolbox allows you to add controls to the design interface by dragging them. You do not need to manually write The XAML code. Adding controls from the Toolbox automatically contains the required namespace on the page. Therefore, you can complete a simple Windows Phone application with few clicks or even no code. But can you enable the Windows Phone toolkit control to automatically add it to the Toolbox after you reference "Microsoft. Phone. Controls. toolkit. dll? No. You must manually add it.

The procedure is as follows:

Step 1: Create a Windows Phone application project

Step 2: Open the Toolbox interface, right-click and choose add tab"

Step 3: Name the newly created tab, such as "wptoolkit"

Step 4: Right-click and select "choose items…" from the menu ..." Option

Step 5: You can see the following interface and select one or more widgets to be displayed in the toolbox.

Step 6: Click OK. Then you can see the selected control.

Step 7: Now you can easily drag the required controls to the design interface.

Example:

Drag a datepicker control to the design interface. Note that the following namespace will be added to the XAML code:

This means that Visual Studio has automatically added the required namespace (The XAML Code has also been automatically generated ):

Now you can define the attributes of datepicker in the code or vs attribute window. If the vs attribute window is not opened by default, you can press Ctrl + W, P or select "View-> Properties window ":

 

How to use Windows Phone toolkit in expression Blend

Expression blend 4 for Windows Phone is installed after Windows Phone developer tools is installed successfully by default. Microsoft Expression blend is a great and fully functional UI design tool. Expression blend mainly includes behaviors, visual State Manager, transition effects, and sketchflow (sketchflow is only included in expression blend 4 flagship Edition) for more information, visit the official website (http://www.microsoft.com/expression/products)

Follow these steps to start using Windows Phone toolkit in expression Blend

Step 1: open expression blend 4 and click "New Project". The following types are available:

Step 2: Create a new Windows Phone application, right-click "references", and select "add reference ..." Find Microsoft. Phone. Controls. toolkit. dll"

Step 3: After adding a reference, open the "assets" tab and you will see all the controls

Step 4: drag the required controls to the Design Interface

Step 5: switch to the XAML interface and you will see that expression blend has automatically added the following namespace

Step 6: You can set the properties of the target control in the Properties window.

 

Statement: I have a limited level of English. I still want to correct some improper translations. All translations are comprehension translations, which are not necessarily consistent with the original one. If incorrect translations occur, the original one shall prevail, it is recommended that you read the original English version directly (not too difficult). The copyright belongs to the original author. Repost this article, please noteArticleSource and author.

Http://www.windowsphonegeek.com/WPToolkitBook2nd

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.