Created
February 19, 2011 11:35
-
-
Save caleb-vear/835014 to your computer and use it in GitHub Desktop.
Put your behaviour where it belongs
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
| // This could just as easily be a command handler in a view model | |
| private void AcceptButton_Clicked(object sender, EventArgs e) | |
| { | |
| if (CurrentNetWeight <= 0) | |
| throw new Exception("Can not accept weights that <= 0"); | |
| Load.GrossWeight = GrossWeight; | |
| Load.TareWeight = TareWeight; | |
| Load.NetWeight = CurrentNetWeight; | |
| Load.WeightAcceptedTime = DateTime.Now; | |
| } |
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
| // This could just as easily be a command handler in a view model | |
| privte void AcceptButton_Clicked(object sender, EventArgs e) | |
| { | |
| // Much better the behaviour and checks related to accepting a weight | |
| // Can go where they belong now | |
| Load.AcceptWeights(GrossWeight, TareWeight); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment