Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attached Properties #4

Open
jarnmo opened this issue Dec 12, 2014 · 1 comment
Open

Attached Properties #4

jarnmo opened this issue Dec 12, 2014 · 1 comment

Comments

@jarnmo
Copy link
Contributor

jarnmo commented Dec 12, 2014

Feel free to comment and discuss Attached Properties here.

What are they good or bad for? Good practices in using them? What kind of issue have you run into? What are the alternatives?

Any thoughts are welcome!

@jarnmo
Copy link
Contributor Author

jarnmo commented Dec 12, 2014

Personally, I've found Attached Properties to be a very handy way to add functionality into controls, especially the ones I'm not in control of. The properties are a bit tedious to create, but very easy to use and I haven't really run into any surprises with them.

I guess the kind of functionality you can implement with Attached Properties is the same as what you can do with Behaviors. With both you can only access the public API of the control in question. However, that is enough for a lot of cases. I'm pretty sure you can't set either in a Style property Setter, at least in WinRT 8.1. You can obviously use both in a data or a control template.

Using behaviors requires you to type a bit more XAML, but they are quite nicely supported by Expression Blend. I'm not sure if AttachedProperties are supported by the designers at all. Also, I haven't measured, but would be interested to hear how they compare on runtime performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant