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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:27:14+00:00 2026-05-13T16:27:14+00:00

Im using WPF which has a Storyboard class that has a Completed event. I

  • 0

Im using WPF which has a Storyboard class that has a Completed event.

I use it like so:

sb.Completed += AddControlToTaskbar;

private void AddControlToTaskbar(object sender, EventArgs args)
{
    //...
}

How to I pass in the EventArgs to my method? Its always null, and I need it to be a custom class

Thanks
Mark

  • 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-13T16:27:14+00:00Added an answer on May 13, 2026 at 4:27 pm

    You don’t pass the EventArgs to your method, the framework which dispatches the event does that. A common way to handle this is to wrap up your AddControlToTaskbar method in a class which stores the state, e.g.:

    sb.Completed += new MyCustomClass(theStateYouNeedToStore).AddControlToTaskbar;
    

    Your constructor stores the state.

    class MyCustomClass<T> {
        private T state;
        public MyCustomClass(T state) {
            this.state = state;
        }
        public void AddControlToTaskbar(object sender, EventArgs args) {
            // Do what you need to do, you have access to your state via this.state.
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple WPF application in which I am using data binding
Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D
I have a WPF window for editing database information, which is represented using an
Using WPF, I have a TreeView control that I want to set its ItemTemplate
I just started using the WPF WebBrowser that is included in Net 3.5 SP1.
Anyone using WPF for real LOB applications? We have all seen the clever demos
I'm building an application in C# using WPF. How can I bind to some
I have a situation where I am using wpf data binding and validation using
i wonder if it is possible to cascade converters when using wpf databinding. e.g.
My company is just starting to look at using WPF for migrating all of

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.