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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:55:44+00:00 2026-06-04T04:55:44+00:00

I think both are same, but why are both used in the same method?

  • 0

I think both are same, but why are both used in the same method? I think there is a minor difference. Here is some code to show the difference between the two:

private void LoadItemListing()
{
    _items = new ObservableCollection<SalesItemListingViewModel>();

    foreach (ItemListing x in _sales.Items)
    {
        SalesItemListingViewModel itemListing = new SalesItemListingViewModel(x);
        _items.Add(itemListing);
        _itemAmountSum += itemListing.Amount;

        itemListing.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(itemListing_PropertyChanged);
    }

    _items.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(_items_CollectionChanged);
}

And for itemListing_PropertyChanged:

void itemListing_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
    if (e.PropertyName == "Amount")
    {
        ItemAmountSum = 0;
        foreach (SalesItemListingViewModel x in Items)
            ItemAmountSum += x.Amount;
    }
}

And this code for _items_CollectionChanged:

void _items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
    if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
    {
        SalesItemListingViewModel newItemListingViewModel = e.NewItems[0] as SalesItemListingViewModel;
        newItemListingViewModel.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(itemListing_PropertyChanged);
    }
    else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
    {
        ItemAmountSum = 0;
        foreach (SalesItemListingViewModel x in Items)
            ItemAmountSum += x.Amount;
    }

    RaisePropertyChanged("Items");
}

I think there is a difference, but I am not sure. Can somebody please explain any difference?

  • 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-04T04:55:45+00:00Added an answer on June 4, 2026 at 4:55 am

    The PropertyChanged signals that the value of a property has changed. The CollectionChanged event signals that the content of a collection has changed (not the collection itself: it’s still the same collection instance, but elements have been added/removed/replaced).

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

Sidebar

Related Questions

Edit I think there is some confusion, I am not using both of the
What is the difference between these two form submission methods? <form method=post action=gert.php onsubmit=return
I feel that both are the same thing, but I am not sure.
Array.Copy and Buffer.BlockCopy both do the same thing, but BlockCopy is aimed at fast
Sometimes I think that Controller and Command are the same because they both encapsulate
I have heard both of these terms used, are they the same thing or
Hi I have a code like this, I think both the friend overloaded operator
What is the difference between while loop and do while loop. I used to
I have both SQL Server 2005 and Visual Studio 2008 installed and think it
I think I might have done something right, headByRating and headByName both refer to

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.