Click here to Skip to main content
15,860,943 members
Articles / Programming Languages / C#
Alternative
Tip/Trick

Naming Properties in MVVM

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
20 Jul 2011CPOL 15.6K   2   7
PropertyChange...
C#
PropertyChanged(this, new PropertyChangedEventArgs(MethodBase.GetCurrentMethod().Name.Substring(4)))

It is slower than your method, but it might not be a big issue and it is much easier to manage from a code perspective.


Not sure it is advisable, but definitely simpler.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Stackify
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Unfortunatly not - I thought Substring(...) would cut the en... Pin
Doc Lobster21-Jul-11 19:52
Doc Lobster21-Jul-11 19:52 
GeneralAbout "it doesn't really remove maintenance concerns", you'r... Pin
Siavash Mortazavi22-Jul-11 17:26
Siavash Mortazavi22-Jul-11 17:26 
GeneralMagic number (4) is account for the prefix "set " || "get "... Pin
Daniel Gidman21-Jul-11 3:44
professionalDaniel Gidman21-Jul-11 3:44 
GeneralYou're right Doc ;) Thanks for your tip :) Pin
Siavash Mortazavi21-Jul-11 3:03
Siavash Mortazavi21-Jul-11 3:03 
GeneralAlso you would have to use a magic number (4) so you still h... Pin
Doc Lobster21-Jul-11 0:44
Doc Lobster21-Jul-11 0:44 
GeneralRe: You're right Doc ;) Thanks for your tip :) Pin
Siavash Mortazavi21-Jul-11 3:04
Siavash Mortazavi21-Jul-11 3:04 
GeneralHi, As you said, yourself, Reflection in to slow; maybe it's... Pin
Siavash Mortazavi20-Jul-11 18:08
Siavash Mortazavi20-Jul-11 18:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.