MainViewModel.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System.Collections.Generic;
  4. using ReactiveUI;
  5. namespace XamlTestApplication
  6. {
  7. public class MainViewModel : ReactiveObject
  8. {
  9. private string _name;
  10. public MainViewModel()
  11. {
  12. Name = "Jos\u00E9 Manuel";
  13. People = new List<Person>
  14. {
  15. new Person("a little bit of Monica in my life"),
  16. new Person("a little bit of Erica by my side"),
  17. new Person("a little bit of Rita is all I need"),
  18. new Person("a little bit of Tina is what I see"),
  19. new Person("a little bit of Sandra in the sun"),
  20. new Person("a little bit of Mary all night long"),
  21. new Person("a little bit of Jessica here I am"),
  22. };
  23. }
  24. public string Name
  25. {
  26. get { return _name; }
  27. set { this.RaiseAndSetIfChanged(ref _name, value); }
  28. }
  29. public List<Person> People { get; set; }
  30. }
  31. public class Person
  32. {
  33. private string _name;
  34. public Person(string name)
  35. {
  36. _name = name;
  37. }
  38. public string Name
  39. {
  40. get { return _name; }
  41. set { _name = value; }
  42. }
  43. }
  44. }