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