Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.


Go Back   Vista Forums > Misc Newsgroups > Avalon

RB

Vista - How to enumerate Dependency properties of a control ?

 
 
01-26-2007   #1
Thierry


 

How to enumerate Dependency properties of a control ?

Hi

I'm searching for enumerate the dependency properties of a control (not specific)

i would to know if a binding exist on the control for example for a textbox i use this code

BindingExpression bindingExpression = ((TextBox)thecontrol).GetBindingExpression(TextBox.TextProperty);

Binding binding = bindingExpression.ParentBinding;

datasourceproperty = bindingExpression.DataItem.GetType().GetProperty(binding.Path.Path);


but i want to generalize this code for work for all controls (the getbindingexpression need an dependencyproperty type to work)

thanks
--
Thierry

My System SpecsSystem Spec
01-29-2007   #2
Thierry


 

Re:[RESOLVED] How to enumerate Dependency properties of a control ?


"Thierry" <newsgroup@delacroix62.fr> a écrit dans le message de
news:7432EAFD-929B-4054-80EB-4F43BA15661F@microsoft.com...
Hi

I'm searching for enumerate the dependency properties of a control (not
specific)

i would to know if a binding exist on the control for example for a textbox
i use this code

BindingExpression bindingExpression =
((TextBox)thecontrol).GetBindingExpression(TextBox.TextProperty);

Binding binding = bindingExpression.ParentBinding;

datasourceproperty =
bindingExpression.DataItem.GetType().GetProperty(binding.Path.Path);


but i want to generalize this code for work for all controls (the
getbindingexpression need an dependencyproperty type to work)

thanks
--
Thierry

My System SpecsSystem Spec
 

RB


Thread Tools


Similar Threads for: How to enumerate Dependency properties of a control ?
Thread Forum
accessing control properties .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd