views:

82

answers:

3

While answering this question I noticed that I have never come across any property which is not a dependency property (WPF Controls, no 3rd party controls). Although, when I started with WPF I remember reading somewhere that "more then 90% of properties of WPF controls are dependency properties".

Can anyone give examples/links of CLR properties in WPF controls and why it's so?

Update:

Came across this lecture: http://www.miszalok.de/Lectures/L17_WPF/C4_DependencyProperties/DependencyProperties.pdf

Which says:

Label has 18 traditional and 71 dependency properties.

Button has 18 traditional and 78 dependency properties.

+1  A: 

Panel.Children or FrameworkElement.Resources are not dependency properties

vc 74
+5  A: 

The PasswordBox property Password is not implemented as dependency property to not allow data binding, which would be a security risk otherwise. See this post for details.

Oliver Hanappi
Ohh yes, I remember one of my colleague facing this issue. Thanks.
akjoshi
+1  A: 

Also the CommandParameters pre WPF 4 was CLR properties!

Taken from MSDN:

Bind to commands on InputBinding. You can bind the Command property of an InputBinding class to an instance that is defined in code. The following properties are dependency properties, so that they can be targets of bindings:

  • InputBinding.Command
  • InputBinding.CommandParameter
  • InputBinding.CommandTarget
  • KeyBinding.Key
  • KeyBinding.Modifiers
  • MouseBinding.MouseAction

http://msdn.microsoft.com/en-us/library/bb613588.aspx

rudigrobler
That doesn't seem right since I usually bind values to them in 3.5sp1
Bryan Anderson
You can bind to clr properties, with one caveat: it will be OneTime binding.
Denis