Windows Vista Forums

obtain type of dependencyproperty

  1. #1


    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?




      My System SpecsSystem Spec

  2. #2


    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?
    >




      My System SpecsSystem Spec

obtain type of dependencyproperty

Similar Threads
Thread Thread Starter Forum Replies Last Post
Design time only DependencyProperty Andy Avalon 3 27 Dec 2007
Copy DependencyProperty with Reflection Horst Klein Avalon 2 10 Jul 2007
No notification when a DependencyProperty value has changed? fö Avalon 0 28 Jun 2007
C++/CLI based DependencyProperty example =?Utf-8?B?Sm9obiBEdW5u?= Avalon 0 23 Aug 2006
How to bind a Trigger to a user defined DependencyProperty Philippe Lavoie Avalon 1 15 Mar 2006