Created
July 17, 2013 10:29
-
-
Save slodge/6019441 to your computer and use it in GitHub Desktop.
This file contains 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
public class FirstViewModel | |
: MvxViewModel | |
{ | |
public readonly INC<string> FirstName = new NC<string>(""); | |
public readonly INC<string> LastName = new NC<string>(""); | |
public readonly INC<TitleResponse> Title = new NC<TitleResponse>(); | |
public readonly INC<bool> Accepted = new NC<bool>(); | |
public readonly ObservableCollection<Person> People = new ObservableCollection<Person>(); | |
public readonly List<TitleResponse> Titles = new List<TitleResponse>() | |
{ | |
TitleResponse.None, | |
TitleResponse.Mr, | |
TitleResponse.Dr, | |
TitleResponse.Mrs, | |
TitleResponse.Ms, | |
TitleResponse.Miss, | |
}; | |
public void Add() | |
{ | |
if (!Accepted.Value) | |
return; | |
People.Add(new Person() | |
{ | |
FirstName = FirstName.Value, | |
LastName = LastName.Value, | |
Title = Title.Value | |
}); | |
Title.Value = TitleResponse.None; | |
FirstName.Value = ""; | |
LastName.Value = ""; | |
Accepted.Value = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment