Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 302297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:05:04+00:00 2026-05-12T07:05:04+00:00

I started a hobby project to learn about WPF and in my reasearch i

  • 0

I started a hobby project to learn about WPF and in my reasearch i stumpled upon this WPF PropertyGrid http://www.codeplex.com/wpg

I downloaded the source from http://wpg.codeplex.com/SourceControl/ListDownloadableCommits.aspx
, And started browsing through it, looks cool, and works. But for the life of me, I can’t figure out HOW it works. The following questions is what I’m left with at first glance.

  • How does it know what properties an object have?
  • How does it render the control to edit a Value?
  • How does it decide what control to render? (i’m guessing meta data descriptions on the properties)

I understand the DependancyProperties handles the dataexchange between new values.

  • Where is the XAML or CodeBehind code that does all the magic?

There is lots of XAML code in the Default.xaml file, but as far as I can tell it is only styles and the looks that are defined there.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:05:04+00:00Added an answer on May 12, 2026 at 7:05 am
    • How does it know what properties an object have?

    It uses System.ComponentModel.TypeDescriptor to determine the properties that a type has via TypeDescriptor.GetProperties. A PropertyDescriptor provides a wealth of information about each property (e.g., PropertyDescriptor.IsReadOnly will tell you that a property is readonly). Further, using PropertyDescriptor.GetValue and PropertyDescriptor.SetValue, the values of properties can be obtained and written to.

    • How does it render the control to edit a Value?
    • How does it decide what control to render? (i’m guessing meta data descriptions on the properties)

    It uses a custom control called a PropertyGrid which exposes an ObservableCollection of Items. Item is merely a base class for the core model object which is Property. Property exposes the underlying type (PropertyDescritor.PropertyType) of the property and exposes the PropertyDescriptor.GetValue and PropertyDescriptor.SetValue methods via Property.Value. This, in turn, is what is bound to to enable the editing. DataTemplates are the key here. A few CLR types have custom DataTemplates that render the controls you see. For example, the Boolean type is rendered as a CheckBox while an Enum is rendered as a ComboBox. The default DataTemplate is a TextBox.

    • Where is the XAML or CodeBehind code that does all the magic?

    The propensity of it is in Themes\Default.xaml.

    The code can be summarized as thus. There is data (Data\Property) that encapsulates the information about properties of an object and provides a property (Property.Value) to read and write the value of a property. This data is exposed as an ObservableCollection in a custom control (PropertyGrid) which is rendered using DataTemplates in Themes\Default.xaml.

    There is lots of XAML code in the Default.xaml file, but as far as I can tell it is only styles and the looks that are defined there.

    Don’t overlook the DataTemplates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a small hobby project ( www.github.com/AzP/GLSL-Validate ) where I've taken old
I have recently started using PlayN for a hobby project and has now stumbled
I just started using Python as hobby, so forgive me if this is a
I started downloading the MVC Template, and created a new project using this template.
Started with this question: OpenID. How do you logout OK. So OpenID does not
Started working on a new application this week that is running the latest rails
Started learning Wicket after ASP.NET MVC and feel a little bit confused about managing
We started a Web Project in Eclipse 3.2 a ways back and we've since
I am starting to use cakePHP for the first time with a hobby project.
I'm a hobbyist, and started learning PHP last September solely to build a hobby

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.