INotifyPropertyChanged for properties that are located in DLL file

For example you have prepared an dll file with some classes in it. Then you want to use this classes in your project. So how can you implement INotifyProperty for properties that are located in dll file. I am using MVVM so this classes are like model.

If I change some value I want to update my UI but I can’t do it because I can’t implement INotifyProperty for classes that are located in my dll file. If you ask why I can’t implement this interface in my own dll file, I will tell you it’s because INotifyProperty is specific interface that we use in WPF projects and what if I don’t want to use WPF. That is why I prepared one dll file where I wrote some kind of business logic classes.

Answer

Really, I think you should just implement INotifyPropertyChanged in the original class in the dll. Implementing INotifyPropertyChanged does not prevent you from using non-WPF UIs. You can always implement additional interfaces if other frameworks require something else. Also, just because WPF uses INotifyPropertyChanged does not mean that it is only for WPF; other frameworks might make use of it as well. I can’t see any reason why you would want to avoid implementing an interface that you need.

That said, if you really don’t want to for some reason, the only other thing I can think of would be to create a wrapper class. That would require a lot of duplicate code (e.g. property declarations). Plus that might not even work if you have some properties that automatically update others, or methods that require arguments of the original type.