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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:33:41+00:00 2026-05-20T10:33:41+00:00

I want to get a notification when object attribute is changed by using reflection.

  • 0

I want to get a notification when object attribute is changed by using reflection.

This is one of class in mjpeg.dll:

public class MJPEGConfiguration : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private string psw;
        public string   password
        {
            get
            {
                return psw;
            }
            set
            {
                psw = value;
                OnPropertyChanged("PSW");
            }
        }

        public virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

In my camera.cs, I set the MJPEGConfiguration object to “object Configuration” and add a PropertyChanged event to this object:

    public object Configuration
    {
        get 
        {
            return configuration; 
        }
        set
        {
            configuration = value;

            Type t = configuration.GetType(); //t is the type of "MJPEGConfiguration"
            EventInfo ei = t.GetEvent("PropertyChanged");
            MethodInfo mi = this.GetType().GetMethod("My_PropertyChanged");
            Delegate dg = Delegate.CreateDelegate(ei.EventHandlerType, mi);
            ei.AddEventHandler(configuration, dg);
        }
    }

    public void My_PropertyChanged(object sender, PropertyChangedEventArgs e)
    {

    }

However, I’m getting ArgumentException(Error binding to Target Method) in the line of “Delegate dg = ….”
How can I fix this problem? Or is there any correct way to do 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-05-20T10:33:42+00:00Added an answer on May 20, 2026 at 10:33 am

    The overload of .CreateDelegate you are calling is trying to bind to a static method. For an instance method, do this:

    Delegate dg = Delegate.CreateDelegate(et, value, mi);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to access a inner object from a notification. I need to get
I want to get started doing some game development using Microsoft's XNA. Part of
I want to get the base 10 logarithm of a Fixnum using Ruby, but
I want to get user input in one page, store that in a php
I want to get a type of a BasePage object that I am creating.
I get this message. The thing is, I want to be able to tell
I'm trying to display a notification using Easy Notification , but I don't want
I want to get the MD5 Hash of a string value in SQL Server
I want to get my databases under version control. I'll always want to have
I want to get an overview of files that are updated in TFS (that

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.