MainViewModel.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. namespace XamlTestApplication
  2. {
  3. using System.Collections.Generic;
  4. using ReactiveUI;
  5. public class MainViewModel : ReactiveObject
  6. {
  7. private string name;
  8. public MainViewModel()
  9. {
  10. Name = "José Manuel";
  11. People = new List<Person>
  12. {
  13. new Person("a little bit of Monica in my life"),
  14. new Person("a little bit of Erica by my side"),
  15. new Person("a little bit of Rita is all I need"),
  16. new Person("a little bit of Tina is what I see"),
  17. new Person("a little bit of Sandra in the sun"),
  18. new Person("a little bit of Mary all night long"),
  19. new Person("a little bit of Jessica here I am"),
  20. };
  21. }
  22. public string Name
  23. {
  24. get { return name; }
  25. set { this.RaiseAndSetIfChanged(ref name, value); }
  26. }
  27. public List<Person> People { get; set; }
  28. }
  29. public class Person
  30. {
  31. private string name;
  32. public Person(string name)
  33. {
  34. this.name = name;
  35. }
  36. public string Name
  37. {
  38. get { return name; }
  39. set { name = value; }
  40. }
  41. }
  42. }