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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:50:38+00:00 2026-06-01T10:50:38+00:00

I have the following class structure class Top : NotifyPropertyChanged { private List<Inner> innerList;

  • 0

I have the following class structure

class Top : NotifyPropertyChanged
{
   private List<Inner>  innerList;

   public bool IsInnerTrue
   {
      get
      {
          foreach (Inner inner in innerList)
          {
             if (inner.IsTrue)
                return true;
          }
          return false;
      };
   }
}

class Inner : NotifyPropetyChanged
{
   private bool isTrue;
   public bool IsTure
   {
      get
      {
         return isTrue;
      }
      set
      {
         isTrue = value;
         NotifyPropretyChanged("IsTrue");      
      }
   }
}

In my view I’m binding to the IsInnerTrue property of the Top class. My problem is that I can’t figure out how to fire the PropertyChanged event for IsInnerTrue when the IsTrue property of one of the Inner objects changes value.

Does anyone have a suggestion, short of setting up an event handler for each Inner object?

  • 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-01T10:50:39+00:00Added an answer on June 1, 2026 at 10:50 am

    Here are two options. One, subscribe to the inner PropertyChanged events:

    class Top : NotifyPropertyChanged
    {
        private List<Inner> innerList = new List<Inner>();
    
        public bool IsInnerTrue
        {
            get
            {
                foreach (Inner inner in innerList)
                {
                    if (inner.IsTrue)
                        return true;
                }
                return false;
            }
        }
    
        public void Add(Inner inner)
        {
            innerList.Add(inner);
            inner.PropertyChanged += InnerPropertyChanged;
        }
    
        public void Remove(Inner inner)
        {
            innerList.Remove(inner);
            inner.PropertyChanged -= InnerPropertyChanged;
        }
    
        private void InnerPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "IsTrue")
                RaisePropertyChanged("IsInnerTrue");
        }
    }
    

    Or two, use a dependency tracking library like Update Controls. These libraries can detect that IsInnerTrue depends upon IsTrue, and will fire the top-level property changed event when the inner property changes.

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

Sidebar

Related Questions

I have the following class structure public class Outer{ private Mapper a; .... private
I have following structure: class Employee { public long Id { get; set; }
I have the following class structure: public class Result { protected int Code {get;
I have the following class structure: class Organization { string Name; List<User> users; List<Organization>
I have following class public class ButtonChange { private int _buttonState; public void SetButtonState(int
I have the following list structure: <ul> <li>One</li> <li>Two <ul> <li class=active>Two-1</li> <li>Two-2</li> </ul>
I have the following data structure: public class Difference { public Difference() { }
I have a list of records with the following structure: (Simplified example!) class Rate
Let's say I have the following class structure: class Car; class FooCar : public
I have the following class structure: class Parent { public function process($action) { //

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.