Simple C# event args question -
I am using WPF which has a storyboard
class in which is completed Is
event.
I use it like this:
sb.Completed + = AddControlToTaskbar; Private Zero AddControlToTaskbar (Object Sender, EventArgs Args) {// ...}
How do I pass in my code in EventArgs
? It's always empty, and I need a custom category
thanks mark
You do not pass EventArgs
for your code, the method that transmits the incident is a common way of handling that your
sb.completed + = new MyCustomClass (theStateYouNeedToStore) .AddControlToTaskbar;
Your constructor stores the state.
class MyCustomClass & lt; T & gt; {Private Tea State; Public MyCustomClass (T-state) {this.state = state; } Public Zero AddControlToTaskbar (Object Sender, EventArgs args) {// What you need to do, you have access to your state through this. }}
Comments
Post a Comment