I have a Library project that holds my logic, and I don’t want it to be dependent on WPF, the question is:
Is there a way to extend the properties to be dependency properties? Or do I actually have to rewrite ALL my properties and variables?! It sounds far-fetched and surreal, yet I think it might be the case, so I’m leaving it to you guys because Google didn’t even understand what I want (unrelated results).
By the way, I read and heard over the time that one primary concept of WPF is separating UI from logic, yet it forces you to make your properties (logic) to dependency properties (UI). It’s kind of ridiculous, isn’t it?
Well, WPF can make bindings to your model objects work out of the box (with some limitations). Check this link. However, as the link notices, that may influence in the memory consumption of your app.
Having said that, the properties of your model objects do not need to be dependency properties to be used in the WPF binding system. They only need to implement INotifyPropertyChanged, that is defined in the System.ComponentModel namespace of the System assembly. This will demand some change in the declaration of the properties in your objects.
Do some research about the MVVM pattern and the INotifyPropertyChanged interface.
Here are some links to get you started:
link
link
link
link