0

I am currently developing a program for drawing graphs using WPF and C#.
I have model classes representing Vertices and Edges, also i have created custom controls to represent these model classes inside the View (on canvas like ellipse and line)
I am linking my models with the view using Binding. I have make the model classes inherit from Dependency object and make my properties Dependency properties in order to improve the performance and the notification between model( which is the view model at the same time) and view .so should i keep them like this (the model is dependency objects) which will keep the performance at top levels or make the model classes separated from the view completely and use INotifyPropertyChanged (but i will lose performance "About 30%")

Mahmoud Heretani
  • 555
  • 1
  • 6
  • 17
  • "but I will lose performance about 30%", what? How did you measure that? – Clemens Dec 21 '16 at 09:36
  • https://www.codeproject.com/articles/62158/dependencyproperties-or-inotifypropertychanged – Mahmoud Heretani Dec 21 '16 at 09:52
  • 1
    You should not believe everything you read on the internet, especially not when it's a couple of years old. Choose the software architecture that better fits your needs, and don't try to optimize performance before you actually have a performance problem. IMO, dependency properties should be used in views, not in view models or models. – Clemens Dec 21 '16 at 09:55
  • 1
    You might also be interested in [this question](http://stackoverflow.com/q/291518/1136211). – Clemens Dec 21 '16 at 10:03
  • You do not serve the pattern, the pattern serves you. This is not even a question, unless performance is not a requirement. –  Dec 21 '16 at 14:37

0 Answers0