Esempio n. 1
0
 private Person GeneratePerson()
 {
     var newPerson = new Person
     {
         Beard = FlipCoin(),
         Favorite = FlipCoin(),
         Goatee = FlipCoin(),
         Height = randomPosition.NextDouble() + 1,
         Moustache = FlipCoin(),
         Name = names[randomPosition.Next(0, names.Count - 1)],
         BirthDate = DateTime.Now - TimeSpan.FromDays(randomPosition.Next(1, 365 * 20)),
     };
     return newPerson;
 }
Esempio n. 2
0
 void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
 {
     _currentPerson = new Person
     {
         Beard = false,
         Favorite = true,
         Goatee = false,
         Height = 1.86,
         Moustache = true,
         Name = "Jesse",
         WhichSex = Person.Sex.Male
     };
     ContentPanel.DataContext = _currentPerson;
     SetDataContext();
     Next.Click += Next_Click;
     
 }
Esempio n. 3
0
        private void SetDataContext()
        {
            ContentPanel.DataContext = GeneratePerson();
            _currentPerson = (Person)ContentPanel.DataContext;

        }
Esempio n. 4
0
 public AddPerson()
 {
     InitializeComponent();
     p           = new Person();
     DataContext = p;
 }