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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:54:03+00:00 2026-06-12T03:54:03+00:00

I have a converter that accepts an ObservableCollection as a parameter, and I’d like

  • 0

I have a converter that accepts an ObservableCollection as a parameter, and I’d like to re-evaluate it whenever a specific property on any item in the collection changes

For example: lets say I have bound a label to a collection of Person objects with a converter. The job of the converter is to count the number of Persons in the list that are female, and return “valid” for 1 female or “accepted” for 2. I’d like the converter to get called again anytime the Gender property on any Person object gets changed.

How can I accomplish this?

  • 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-12T03:54:04+00:00Added an answer on June 12, 2026 at 3:54 am

    That’s a classic problem you end up having if you play around WPF long enough.

    I’ve tried various solutions, but the one that works best is to use a BindingList like so:

    public class WorldViewModel : INotifyPropertyChanged
    {
       private BindingList<Person> m_People;
       public BindingList<Person> People
       {
          get { return m_People; }
          set
          {
             if(value != m_People)
             {
                m_People = value;
                if(m_People != null)
                {
                   m_People.ListChanged += delegate(object sender, ListChangedEventArgs args)
                   {
                      OnPeopleListChanged(this);
                   };
                }
                RaisePropertyChanged("People");
             }
          }
       }
    
       private static void OnPeopleListChanged(WorldViewModel vm)
       {
          vm.RaisePropertyChanged("People");
       }
    
       public event PropertyChangedEventHandler PropertyChanged;
       void RaisePropertyChanged(String prop)
       {
          PropertyChangedEventHandler handler = this.PropertyChanged;
          if (handler != null)
          {
              handler(this, new PropertyChangedEventArgs(prop));
          }
       }
    }
    

    Then just bind to the People collection like you would do with an ObservableCollection, except bindings will be re-evaluated when any property in its items change.

    Also, please note that OnPeopleListChanged is static, so no memory leaks.

    And Person should implement INotifyPropertyChanged.

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

Sidebar

Related Questions

I have a method that accepts an Expression<Func<T, bool>> as a parameter. I would
I have a repository method that accepts an order by parameter in the form:
I have a function that accepts an array parameter as array('employee_name' => 'employee_location' )
I have a stored procedure that accepts an xml parameter (SqlDbType.Xml) that is being
I have a piece of code that the ARC converter turned into this... //
I decided to create a currency converter in Java, and have it so that
I have a webpage that accepts HTML-input from users. The input is converted into
I have a small python cgi script that accepts an image upload from the
I have a form that, among other things, accepts an image for upload and
I have a function that accepts a string and generates an email attachment based

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.