c# - WPF MVVM: Replace control with minimum changes -


this going first project wpf , it's quite big. more concerned design (not presentation) aspect here. might necessary replace control in future should done minimum , centralized changes.

examples: -

  • i use standard button control @ 100 places in project. tomorrow, may need modify buttons in project display fixed image in center , border red , append text "trial" actual text of each button. styles serve purpose in cases here not time.

  • i use standard grid view today find not fulfill requirements , decide use other/third party control.

in above (and may other) cases, should easy replace control @ 1 place in project , should take effect @ locations in entire project. @ least, changes should minimum.

i read usercontrol , custom control, both not serve purpose @ least in little understanding.

question: - practice design application in way? or overthinking? if yes, way achieve in wpf?

you're overthinking, button in wpf not in winform, not "a square area text when click on it" "something when click on it". controls in wpf have built in styles can override , able restyle them appliation wide without touching them don't think custom here. if need have something when click on it, use <button /> , stop thinking it, you'll able buttons application wide without touching of them later on applying style @ level (whole application, single window, single area of window etc)

have @ project example, doesn't involve touching of made files, changes whole application look: https://wpfthemes.codeplex.com/

as changing whole components (replacing gridview vendor's gridview) should straightforward if using mvvm, long presentation binding data, nothing few lines should need changing


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -