As few people told me to implement an observer in my last post where I just showed how to use it, here is the post where I am going to clear out confusions for you. If you have read my other post, you might already know what is an Observer and why it is required. Lets recap this a bit more.
An observer is a container which observes each element individually and notifies you when the object state is modified. The observer should contain methods that enables you to subscribe or unsubscribe individually so that when you subscribe for a notification, it will keep on creating notification until you explicitly unsubscribe the Observer.
In .NET base class library, there are two interfaces introduced viz, IObservable
In this post, I will discuss how you could use IObserver and IObservable to implement you own notifiers.
Download Sample - 33KB
Read Disclaimer Notice