Understanding attached properties


show more Understanding attached properties provides you with in-depth training on Developer. Taught by Walt Ritscher as part of the Silverlight 5 Essential Training show less
please wait ...

Understanding attached properties

Attached Properties are an elegant solution to an old problem. For illustration of the problem, let's look at the Windows form model. The form class in Windows forms serves as a container for controls. The form excels at arranging the child controls on the screen. You can set the position of each control with an X and Y coordinate, or you can use other layout methods like Docking and Anchoring. The Windows forms controls are tied to the forms implementation. They have dedicated properties like Button.Left or Button.Dock or even TextBox.Anchor.

The problem with this model is that you end up with tight coupling between the form and any controls that are hosted by the form. If an innovative new layout ID appears, both the form and every hosted control must be changed to make this work. Granted, you can create a control base class to mitigate some of the coupling, but there are other issues. For an example, let's say you come up with an innovative new polar layout where controls are a...

Understanding attached properties
Video duration: 6m 15s 8h 52m Beginner

Viewers:

Understanding attached properties provides you with in-depth training on Developer. Taught by Walt Ritscher as part of the Silverlight 5 Essential Training

Subject:
Developer
Software:
Silverlight Visual Studio
Author:
please wait ...