Learn Windows Phone7 development together (13. 10 Silverlight. Toolkit Control)

Source: Internet
Author: User

Silverlight. Toolkit is a collection of Silverlight controls, components, and utilities released outside of common Silverlight. Is a product of the Microsoft silverlight team. It quickly adds new features to designers and developers and provides communities to help develop products by contributing ideas and error reports. It contains complete open-source code, unit testing, instances and documents, styles, la S, and user input for over 26 new controls. However, this set is not fully supported in Phone7.

To use this set, you need to download this package:

Http://silverlight.codeplex.com/releases/view/43528

 

1. wrapPanel: This panel control mainly uses the Orientation attribute to set the position from left to right or from top to bottom of the control's elements. When the element exceeds the edge of the control, they will be automatically transferred to the next row or column. This control is generally used for text layout, color picker, and images. System. Windows. Controls. Toolkit. dll needs to be loaded

 

Xaml:

<ControlsToolkit: WrapPanel x: Name = "wp1" Margin = "15,0, 15,201" Grid. row = "1" Width = "350" Height = "300" VerticalAlignment = "Bottom" Orientation = "Horizontal"/>

Source code:

For (int I = 0; I <30; I ++)

{

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. Yellow )});

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. Purple )});

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. Red )});

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. Black )});

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. Brown )});

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. Cyan )});

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. DarkGray )});

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. Green )});

Wp1.Children. Add (new Rectangle () {Height = 50, Width = 50, Fill = new SolidColorBrush (Colors. Magenta )});

 

}

 

 

2. Accordion: the Accordion control, which can be expanded or closed, similar to the QQ friends list. You can also set different expansion directions. System. Windows. Controls. Layout. Toolkit. dll needs to be loaded.

<LayoutToolkit: Accordion Grid. Row = "1" HorizontalAlignment = "Stretch" verticalignment = "Stretch" ExpandDirection = "Down">

<LayoutToolkit: AccordionItem Header = "First" Height = "150">

<LayoutToolkit: AccordionItem. HeaderTemplate>

<DataTemplate>

<TextBlock Text = "First" Height = "40" FontSize = "32"/>

</DataTemplate>

</LayoutToolkit: AccordionItem. HeaderTemplate>

<TextBlock Text = "test1"/>

</LayoutToolkit: AccordionItem>

<LayoutToolkit: AccordionItem Header = "Second">

<TextBlock Text = "test2"/>

</LayoutToolkit: AccordionItem>

<LayoutToolkit: AccordionItem Header = "Third">

<TextBlock Text = "test3"/>

</LayoutToolkit: AccordionItem>

</LayoutToolkit: Accordion>

ExpandDirection: set the direction after expansion.

 

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.