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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:03:26+00:00 2026-05-15T09:03:26+00:00

This question is only related to the first parameter in any event handler, that

  • 0

This question is only related to the first parameter in any event handler, that is ‘object’.

I am just curious to understand the best practice that should be adopted while raising an event.

The case is simple when the event is originated from my object itself, in that case i can simply call…
RaiseSomeEvent(this, someArgs).

What should be done in case my object is acting as a middle man, and the event originates from some other object, and the middle man is just responsible for raising it again?
In that case, i will have two choice:

1) RaiseSomeEvent(sender, someArgs) // just passing the object that was passed by the source object.
2) RaiseSomeEvent( this, someArgs)

Is there any rule regarding the ‘object’ param of an event? like, it should have reference to the source object (the one which triggered this event), or i can do it anyway as per my requirement?

  • 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-15T09:03:27+00:00Added an answer on May 15, 2026 at 9:03 am

    I would use the framework here for inspiration.

    Typically, the case is the simplest – the object is the object raising the event.

    However, there are cases where objects “filter” events and act as a middle man in the framework. The case that comes to mind is Routed Events in WPF –

    In this case, the Framework uses the approach of adding a property in the EventArgs that specifies the original object, and uses “this” for the event. For details, see RoutedEventArgs.OriginalSource.

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

Sidebar

Related Questions

First of all: This question is not directly programming related. However, the problem only
Please note this question related to performance only. Lets skip design guidelines, philosophy, compatibility,
I've looked at this question: Select first instance only with XPath? But if I
Please note that this question is from 2008 and now is of only historic
(Since this is my first SO question, let me just say I hope it's
My question is related to this question. You will have to first read it.
Slightly related to this question , but you don't really need to read that.
First of all, I looked up this related question in here but the solution
First and foremost, I apologize for any vagueness in this question. At this point,
This question is closely related to Jquery - Send only some value from a

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.