Jyncus
November 22nd, 2008, 09:00 PM
Using: c# 3.0 / .NET 3.5b
Hi!
This may sound like an elementary question, but I'm fairly new to c#. =] Is is possible to raise an event when say.. a property changes for a given object?
The property can be changed directly or indirectly by the user interacting with the form. The property I'm trying to "listen to" is the .Count on a List<T> object. The user has various GUI controls to add/remove items from the list which will obviously change the count. I'm attempting to perform some action (update the list data displayed on the form) dynamically by having an event raised when List.Count changes, and then using the event handler to immediately update the displayed List.
Thanks for the help.
Hi!
This may sound like an elementary question, but I'm fairly new to c#. =] Is is possible to raise an event when say.. a property changes for a given object?
The property can be changed directly or indirectly by the user interacting with the form. The property I'm trying to "listen to" is the .Count on a List<T> object. The user has various GUI controls to add/remove items from the list which will obviously change the count. I'm attempting to perform some action (update the list data displayed on the form) dynamically by having an event raised when List.Count changes, and then using the event handler to immediately update the displayed List.
Thanks for the help.