Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

obtain type of dependencyproperty

Closed Thread
 
Thread Tools Display Modes
Old 01-12-2007   #1 (permalink)
Robert Ludig
Guest


 

obtain type of dependencyproperty

When I register a DepencyPorperty I can specify what type it is
supposed to store. How can I find out what type is set for a
DepenencyProperty of a class? Is it possible to find this out without
actually having instance of a class? For example how do I find out
programmatically that UIElement.FocusableProperty is a boolean without
actually having an instance of an UIElement?

Old 01-12-2007   #2 (permalink)
Stoitcho Goutsev \(100\)
Guest


 

Re: obtain type of dependencyproperty

Robert,

Each dependency property has a dependency property static object that is
used to access its local value. This DependencyProperty object keeps all
metadata information regarding the proeprty itself.
Usually these objects are public so they are accessible. To find out the
type of the UIElement.FocusableProperty you need to do

Type t = UIElement.FocusableProperty.PropertyType;

You don't need instnace of UIElement since FocusableProperty is a static
member of the class.


--
HTH
Stoitcho Goutsev (100)

"Robert Ludig" <schwertfischtrombose@gmx.de> wrote in message
news:1168611497.732454.280190@q2g2000cwa.googlegroups.com...
> When I register a DepencyPorperty I can specify what type it is
> supposed to store. How can I find out what type is set for a
> DepenencyProperty of a class? Is it possible to find this out without
> actually having instance of a class? For example how do I find out
> programmatically that UIElement.FocusableProperty is a boolean without
> actually having an instance of an UIElement?
>



Old 01-12-2007   #3 (permalink)
Stoitcho Goutsev \(100\)
Guest


 

Re: obtain type of dependencyproperty

Robert,

Each dependency property has a dependency property static object that is
used to access its local value. This DependencyProperty object keeps all
metadata information regarding the proeprty itself.
Usually these objects are public so they are accessible. To find out the
type of the UIElement.FocusableProperty you need to do

Type t = UIElement.FocusableProperty.PropertyType;

You don't need instnace of UIElement since FocusableProperty is a static
member of the class.


--
HTH
Stoitcho Goutsev (100)

"Robert Ludig" <schwertfischtrombose@gmx.de> wrote in message
news:1168611497.732454.280190@q2g2000cwa.googlegroups.com...
> When I register a DepencyPorperty I can specify what type it is
> supposed to store. How can I find out what type is set for a
> DepenencyProperty of a class? Is it possible to find this out without
> actually having instance of a class? For example how do I find out
> programmatically that UIElement.FocusableProperty is a boolean without
> actually having an instance of an UIElement?
>



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design time only DependencyProperty Andy Avalon 3 12-27-2007 11:45 AM
Copy DependencyProperty with Reflection Horst Klein Avalon 2 07-10-2007 08:32 AM
No notification when a DependencyProperty value has changed? fö Avalon 0 06-28-2007 11:20 AM
C++/CLI based DependencyProperty example =?Utf-8?B?Sm9obiBEdW5u?= Avalon 0 08-23-2006 04:57 PM
How to bind a Trigger to a user defined DependencyProperty Philippe Lavoie Avalon 1 03-15-2006 03:21 PM








Vistax64.com 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 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50