Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2005

Tip: Looking for answers? Try searching our database.

Events

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ferdinand Zaubzer - 15 Dec 2005 15:45 GMT
As far as I know events are fired by invoking a method.
Is it possible that events are fired if a boolean property changes its
value?

Thanks
Ferdinand
Nicholas Paldino [.NET/C# MVP] - 15 Dec 2005 15:53 GMT
Ferdinand,

   Events can be fired for any reason whatsoever.  It is up to the defining
class to indicate when events should be fired.

   There is nothing that says you can't fire an event if a property changes
it's value.

   If you want to do this, you should look into the INotifyPropertyChanged
interface, as it defines a standard event that is used to indicate when a
property changes.

   Hope this helps.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> As far as I know events are fired by invoking a method.
> Is it possible that events are fired if a boolean property changes its
> value?
>
> Thanks
> Ferdinand
Bruce Wood - 15 Dec 2005 17:42 GMT
Very interesting. Does this mean that MS is abandoning the

public xxxx MyProperty ...

public event yyyy MyPropertyChanged;

protected void OnMyPropertyChanged() ...

pattern in favour of this new INotifyPropertyChanged interface?

> Ferdinand,
>
[quoted text clipped - 20 lines]
> > Thanks
> > Ferdinand
Nicholas Paldino [.NET/C# MVP] - 15 Dec 2005 18:22 GMT
Bruce,

   It's not abandoning it.  However, it does prefer that you use that, as
it offers a performance gain (you don't have a gazillion delegates to hook
up to to detect property changes).

   WPF is going to take advantage of this as well.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Very interesting. Does this mean that MS is abandoning the
>
[quoted text clipped - 33 lines]
>> > Thanks
>> > Ferdinand

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.