define a custom attached property

Once we reach a basic understanding of something sophisticated like Attached Property, looking at a custom AProp implementation could bring us to the next level. points out

“If your class (the Provider class) is defining the attached property strictly for use on other types, then the provider class does not need to derive from DependencyObject. But you do need a DependencyObject as the method parameter in the getter/setter.

Define your attached property as a dependency property by declaring a public static readonly field of type DependencyProperty.”


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s