Lecture 5th: user templates

Source: Internet
Author: User
Tags visual studio 2010

2010.11.5 su Peng

Content

-Understand Styles and ControlTemplates

-Understanding ResourceDictionaries

-Understand user-defined controls

 

Prerequisites

-Install Visual Studio 2010

-Install Expression Blend4

-Install Silverlight tools for Visual Studio 2010

-Understand C #

 

Reusable resources

-Styles)

-ControlTemplates

-UserControls

 

ControlTemplate

-What is Style?

-Relationship between ControlTemplate and Style

 

The Style of a separate control is a Style. Multiple styles constitute a ControlTemplate.

 

Blend4 demo

-Custom Style

-Custom ControlTemplates

-Custom UserControlers

Draw a rectangle, Make Into Control, and select Button. The rectangle we draw will inherit from the Button class and have all its events.

You can select the resource storage location

We can see that Listbox is essentially a Grid plus a Border.

Custom Controls

 

DependencyProperty

-What is the purpose?

 

To process the binding relationship, we often want to modify the data at the front end and back end at the same time. The foreground is the property of the control, and the background is the memory object. DependencyProperty is defined to ensure the consistency of the front and back-end modifications.

 

Demo

-Add attributes to the Custom button

Bind Text to our defined DependencyProperty.

 

Summary

-Understand Styles and ControlTemplates

-Understanding ResourceDictionaries

-Understand user-defined controls

2010.11.21

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.