Last active
December 17, 2015 10:48
-
-
Save SimonCropp/5597182 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // * Dont need [ImplementPropertyChanged] since it will be detected from the base class | |
| // * Namespaces are noise. dont use them | |
| // * use fielder so you dont need properties https://github.com/Fody/Fielder | |
| // * I prefer property injection. simply less code | |
| // * fields allow me to initialise them outside the constructor | |
| public class FirstViewModel : MvxViewModel | |
| { | |
| public ICalculationService CalculationService; | |
| public double Generosity = 20; | |
| public double SubTotal = 100; | |
| public double Tip | |
| { | |
| get { return CalculationService.Tip(SubTotal, Generosity); } | |
| } | |
| public double Total | |
| { | |
| get { return SubTotal + Tip; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment