DependencyProperty Strangeness?

TitleProperty is not a normal property but a dependency property so if you want to retrieve the value of your TitleProperty you have to do : var title = (string)GetValue(TitleProperty) In WPF guideline, the public property to access a Dependency Property is not called by WPF and the binding engine (not necessary). This public property is only used by your code behind. So you MUST not add code logic inside your public property But you can use a FrameworkPropertyMetadata when you register your DP and provide a CoerceValueCallback to change the setted value You can also use a IValueConverter with your binding.

TitleProperty is not a normal property but a dependency property so if you want to retrieve the value of your TitleProperty you have to do : var title = (string)GetValue(TitleProperty); In WPF guideline, the public property to access a Dependency Property is not called by WPF and the binding engine (not necessary). This public property is only used by your code behind. So you MUST not add code logic inside your public property.

But you can use a FrameworkPropertyMetadata when you register your DP and provide a CoerceValueCallback to change the setted value. You can also use a IValueConverter with your binding.

Ok but I am retrieving it from XAML, e.g. So I just have access to the public property "Title" – Edward Tanguay Feb 9 '09 at 13:44 Edvward, in WPF guideline, the public property to access a Dependency Property is not called by WPF and the binding engine (not necessary). This public property is only used by your code behind.So you MUST not add code logic inside your public property. – Nicolas Dorier Feb 9 '09 at 15:13 If you don't believe me, try to bind something to a dependency property without writing a public property, this will work.

– Nicolas Dorier Feb 9 '09 at 15:14.

Hmm, that doesn't work for me, it just returns the value but not " postfix" at the end. When I set the property I want to prefix it with a property of the object (Kind) but it is not set at that point, so I can add text but not property values of the object, equally odd. – Edward Tanguay Feb 9 '09 at 14:45.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions