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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:29:34+00:00 2026-05-26T05:29:34+00:00

i have this code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data;

  • 0

i have this code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.ComponentModel;
using System.Collections.Specialized;
using System.Collections.ObjectModel;

namespace Bix
{
    public class SettingsDataObject
    {
        private int id;
        public int Id
        {
            get { return id; }
            set { id = value == 0 ? Db.GetNextSettingsId() : value; }
        }
        private string adminEmail; public string AdminEmail { 
            get { return adminEmail; } 
            set { adminEmail = value; } 
        }
        private int state; public int State { get { return state; } set { state = value == 0 ? 1 : value; } }

        public object[] GetArray()
        {
            return new object[] { id, adminEmail, state };
        }

        public SettingsDataObject()
        {

        }
    }

    public class SettingsUIObjects : ObservableCollection<SettingsUIObject>,INotifyPropertyChanged
    {
        protected override void InsertItem(int index, SettingsUIObject item)
        {
            base.InsertItem(index, item);

            // handle any EndEdit events relating to this item
            item.ItemEndEdit += new SettingsUIObject.ItemEndEditEventHandler(ItemEndEditHandler);
            item.PropertyChanged += new SettingsUIObject.PropertyChangedEventHandler(PropertyChanged);
        }

        public void ItemEndEditHandler(IEditableObject sender)
        {
            // simply forward any EndEdit events
            if (ItemEndEdit != null)
            {
                ItemEndEdit(sender);
            }
        }

        public event SettingsUIObject.ItemEndEditEventHandler ItemEndEdit;
        public event SettingsUIObject.PropertyChangedEventHandler PropertyChanged;
    }

    public class SettingsDataProvider
    {
        private DataAccessLayer dl;

        public SettingsDataProvider()
        {
            dl = new DataAccessLayer();
        }

        public SettingsUIObjects GetSettings()
        {
            try
            {
                SettingsUIObjects objs = new SettingsUIObjects();

                List<SettingsDataObject> objDataObjects = dl.GetSettings();
                foreach (SettingsDataObject obj in objDataObjects)
                {
                    objs.Add(new SettingsUIObject(obj));
                }

                objs.ItemEndEdit += new SettingsUIObject.ItemEndEditEventHandler(SettingsItemEndEdit);
                objs.CollectionChanged += new
                  NotifyCollectionChangedEventHandler(SettingsCollectionChanged);
                objs.PropertyChanged += new SettingsUIObject.PropertyChangedEventHandler(SettingsPropertyChanged);
                return objs;
            }
            catch (Exception) { return new SettingsUIObjects(); }
        }

        void SettingsItemEndEdit(IEditableObject sender)
        {
            SettingsUIObject obj = sender as SettingsUIObject;

            // use the data access layer to update the wrapped data object
            dl.UpdateSettings(obj.GetDataObject());
        }

        void SettingsPropertyChanged(INotifyPropertyChanged sender, PropertyChangedEventArgs e)
        {
            SettingsUIObject obj = sender as SettingsUIObject;

            // use the data access layer to update the wrapped data object
            dl.UpdateSettings(obj.GetDataObject());
        }

        void SettingsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Remove)
            {
                foreach (object item in e.OldItems)
                {
                    SettingsUIObject obj = item as SettingsUIObject;

                    // use the data access layer to delete the wrapped data object
                    dl.DeleteSettings(obj.GetDataObject());
                }
            }
            if (e.Action == NotifyCollectionChangedAction.Add)
            {
                foreach (object item in e.NewItems)
                {
                    SettingsUIObject obj = item as SettingsUIObject;

                    // use the data access layer to delete the wrapped data object
                    dl.UpdateSettings(obj.GetDataObject());
                }
            }
        }
    }

    public class SettingsUIObject : IEditableObject, INotifyPropertyChanged
    {
        private SettingsDataObject obj;
        public SettingsUIObject(SettingsDataObject o)
        {
            obj = o;
        }

        public SettingsDataObject GetDataObject()
        {
            return obj;
        }

        public int Id { get { return obj.Id; } set { obj.Id = value; } }
        public string AdminEmail { 
            get { return obj.AdminEmail; } 
            set { obj.AdminEmail = value; } 
        }

        public delegate void ItemEndEditEventHandler(IEditableObject sender);

        public event ItemEndEditEventHandler ItemEndEdit;

        #region IEditableObject Members

        public void BeginEdit() { }

        public void CancelEdit() { }

        public void EndEdit()
        {
            if (ItemEndEdit != null)
            {
                ItemEndEdit(this);
            }
        }

        #endregion

        public delegate void PropertyChangedEventHandler(INotifyPropertyChanged sender, PropertyChangedEventArgs e);
        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

    }
}

and i keep getting the compile error:

‘Bix.SettingsUIObject’ does not implement interface member ‘System.ComponentModel.INotifyPropertyChanged.PropertyChanged’. ‘Bix.SettingsUIObject.PropertyChanged’ cannot implement ‘System.ComponentModel.INotifyPropertyChanged.PropertyChanged’ because it does not have the matching return type of ‘System.ComponentModel.PropertyChangedEventHandler’

can anyone tell me why?

thanks

Orson

  • 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-05-26T05:29:35+00:00Added an answer on May 26, 2026 at 5:29 am
        public delegate void PropertyChangedEventHandler(INotifyPropertyChanged sender, PropertyChangedEventArgs e);
        public event PropertyChangedEventHandler PropertyChanged;
    

    Your code redeclares a PropertyChangedEventHandler delegate, which hides the one declared in System.ComponentModel. So your event is of type SettingsUIObject.PropertyChangedEventHandler, not System.ComponentModel.PropertyChangedEventHandler. Since the type doesn’t match the one declared in INotifyPropertyChanged, your PropertyChanged event doesn’t a valid implementation of the interface.

    Just remove your PropertyChangedEventHandler delegate and it should work fine.

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

Sidebar

Related Questions

i have the following code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using
i have the following code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using
I have this code in my code behind. using System; using System.Collections.Generic; using System.Linq;
I have an asynchronous socket listener class like this: using System; using System.Collections.Generic; using
I have this code :- using (System.Security.Cryptography.SHA256 sha2 = new System.Security.Cryptography.SHA256Managed()) { .. }
I have this code #include <iostream> using namespace std; int main(int argc,char **argv) {
I have this code: using DC = MV6DataContext; using MV6; // Business Logic Layer
I have been using code similar to this MessageDlg('', mtWarning, [mbOK], 0); throughout my
I'm using PHP5 to create XML files. I have code like this: $doc =
I have this code in jQuery, that I want to reimplement with the prototype

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.