Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to assign value to events property in usercontrol using wpf?
Posted
Comments
Sergey Alexandrovich Kryukov 5-Jun-12 1:24am    
What value? Event instances do not have properties you can work with... Why?..
--SA

1 solution

You cannot to it, for a good reason. This is not how events work; this is never needed. In general, events are very limiting objects, thanks to their fool-proof features. You cannot even raise an event nowhere outside the class where it is declared, not even in derived class. All you can do is using "+=" and (rarely) "-=" operators.

If you do not know what it is, you need to read about delegates and than about events in .NET. As you did not share your purpose with us, that's all help you can get for now.

—SA
 
Share this answer
 
Comments
Maciej Los 5-Jun-12 15:01pm    
Good explanations, my 5!
Sergey Alexandrovich Kryukov 5-Jun-12 15:13pm    
Thank you, Maciej.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900