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

  • Home
  • SEARCH
  • 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 173055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:16:30+00:00 2026-05-11T13:16:30+00:00

This one is fairly complex, hopefully I can make this clear enough for somebody

  • 0

This one is fairly complex, hopefully I can make this clear enough for somebody to help me out. I have an object lets call it a Manager, the Manager has a collection of people that he manages, the people all implement IPerson, but different types of people have different properties. I want to display this manager in a tree, and under the manager node I want to show all the projects he is managing which can be determined from the people he manages.

So the plan is to use a converter to convert a person into a List of projects. Here is the XAML:

<HierarchicalDataTemplate DataType='{x:Type ui:Manager}'>    <TextBlock Text='{Binding Path=Name}'/>     <HierarchicalDataTemplate.ItemTemplate>         <DataTemplate>                     <TextBlock Text='{Binding}'/>         </DataTemplate>     </HierarchicalDataTemplate.ItemTemplate>     <HierarchicalDataTemplate.ItemsSource>         <Binding Path='People'>             <Binding.Converter>                 <configUtil:ProjectListConverter/>             </Binding.Converter>         </Binding>     </HierarchicalDataTemplate.ItemsSource> </HierarchicalDataTemplate> 

My Person class implements INotifyPropertyChanged, and the list holding the people implements INotifyCollectionChanged.This code works great when I set the treeview ItemsSource, the Managers are displayed with their list of projects.

However, when I add a new person to the list of people, the TreeView is not updated. When I debug, I can see that the CollectionChanged is firing with the Add action and the added item. Also the CollectionChanged event is not null so I know the UI is watching it. But the Converter does not execute when the item is added.

here is the Add method for the List holding the IPerson objects:

public void Add(T item) {     list.Add(item);     OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item)); } 

Am I somehow breaking the databinding?

What other things can I check for?

The Converter just looks at each item in the People list and figures out what projects they are working on and adds the project name to an output List.

  • 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. 2026-05-11T13:16:31+00:00Added an answer on May 11, 2026 at 1:16 pm

    The converter is applied to the property that stores the collection. Therefore, it will only be called if the collection instance itself changes (not if items in the collection are changed). One way around this would be to invalidate the collection when you want it to refresh.

    The simplest way to invalidate the collection property and cause the converter code to run again would be to null out the collection and reassign it. Another way is to get the BindingExpression (via BindingOperations) and call UpdateTarget. Finally, you could instead bind to a CollectionView (or subclass thereof) and call Refresh on it.

    And if you really want to fix the problem cleanly, you could bind to your own implementation of ICollectionView which does the filtering and raises events as necessary.

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

Sidebar

Ask A Question

Stats

  • Questions 163k
  • Answers 163k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Unfortunately, there doesn't seem to be any way to get… May 12, 2026 at 12:13 pm
  • Editorial Team
    Editorial Team added an answer Generally you should move to Core Animation for 10.5+ code.… May 12, 2026 at 12:13 pm
  • Editorial Team
    Editorial Team added an answer The error appears because your private constructor is calling a… May 12, 2026 at 12:13 pm

Related Questions

I've been working with the SpiderMonkey C API and would like to implement a
Yes, there is a similar question here . However, that question doesn't seem to
I am having trouble with my Visual Studio 2005 IntelliSense for some time now.
I'm currently working on a class that calculates the difference between two objects. I'm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.