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 7976013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:48:15+00:00 2026-06-04T08:48:15+00:00

I am looking into the logistics of adding several WPF features to a 1,000,000+

  • 0

I am looking into the logistics of adding several WPF features to a 1,000,000+ line code-base. I am looking into using databinding and DataTemplates in XAML to easily display various objects. I am able to bind an observable collection: points to a ListBox and if I don’t use a template, I can just provided a meaningful toString for the list items and that gets me somewhere. The problem comes in when I want to use a template to display various properties of the list items. It is my understanding that they all have to be DependencyProperties. parent is just a property. It looks like adding dependency properties is fairly complicated. All the classes you want to display have to inherit from DependencyObject and you have to set a bunch of stuff for each property you want to use. This does not seem feasible for a large codebase, to have to do all this for each property.
I’m wondering how databinding is used in practice, do you really add crap-tons of dependency properties to all of your classes or is there a better way?

Thanks!

    <ListBox Name="listBox1" 
             ItemsSource="{Binding Source={StaticResource points}}">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel>
                    <TextBlock Text="Point!"/>
                    <TextBlock Text="{Binding parent}"/>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
  • 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-06-04T08:48:17+00:00Added an answer on June 4, 2026 at 8:48 am

    The problem comes in when I want to use a template to display various properties of the list items. It is my understanding that they all have to be DependencyProperties. parent is just a property. It looks like adding dependency properties is fairly complicated. All the classes you want to display have to inherit from DependencyObject and you have to set a bunch of stuff for each property you want to use.

    This is not true.

    You need to use a Dependency Property or have your type implement INotifyPropertyChanged, but this is only required if you want the binding to work bi-directionally. This requirement exists so that WPF gets notified when a property value changes, and the UI can update automatically. However, if the property value isn’t changing while the screen is displayed, there is no requirement (other than the value be a Property, and not a Field).

    If you’re just displaying the values within the object, and they won’t change while being displayed, standard properties will work fine.

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

Sidebar

Related Questions

Looking into using the command line tool for KeyChain. I am able to do
I'm looking into using a IOC container but I'm working with legacy code and
Am looking into developing an iPhone native app using Titanium Developer Since this is
I am looking into adding unit tests at work. I used MbUnit in the
I'm looking into adding some unit tests for some classes in my data access
While looking into the IndexedDB API, I have found several examples of event handlers
Im looking into documenting the javascript code we develop and are looking for some
I am looking into the pointers and I came up with code like that
I am looking into using the new SQL Server Express LocalDB (I think it
looking into multi file - drag and drop - upload scripts. we were using

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.