Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace GOT_PTTK_PRACOWNIK.Model
  9. {
  10. public class TurystaModel : INotifyPropertyChanged, IComparable<TurystaModel>
  11. {
  12. private long id;
  13. private string imie;
  14. private string nazwisko;
  15.  
  16. public long Id
  17. {
  18. get
  19. {
  20. return id;
  21. }
  22. set
  23. {
  24. if(id!=value)
  25. {
  26. id = value;
  27. RaisePropertyChanged("Id");
  28. }
  29. }
  30. }
  31.  
  32. public string Imie{
  33. get{
  34. return imie;
  35. }
  36. set
  37. {
  38. if(imie!=value)
  39. {
  40. imie = value;
  41. RaisePropertyChanged("Imie");
  42. }
  43. }
  44. }
  45.  
  46. public string Nazwisko
  47. {
  48. get
  49. {
  50. return nazwisko;
  51. }
  52. set
  53. {
  54. if (nazwisko != value)
  55. {
  56. nazwisko = value;
  57. RaisePropertyChanged("Nazwisko");
  58. }
  59. }
  60. }
  61.  
  62. public event PropertyChangedEventHandler PropertyChanged;
  63.  
  64. private void RaisePropertyChanged(string property)
  65. {
  66. if (PropertyChanged != null)
  67. {
  68. PropertyChanged(this, new PropertyChangedEventArgs(property));
  69. }
  70. }
  71.  
  72. public int CompareTo(TurystaModel other)
  73. {
  74. return id.CompareTo(other.Id);
  75. }
  76.  
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement