Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using XamFormsMVVM.Models;
  2. using XLabs.Forms.Mvvm;
  3.  
  4. namespace XamFormsMVVM.ViewModels
  5. {
  6.     public class ContactViewModel : ViewModel
  7.     {
  8.         private readonly Contact _contact;
  9.  
  10.         public string Profession
  11.         {
  12.             get { return _contact.Profession; }
  13.             set
  14.             {
  15.                 if (_contact.Profession != value)
  16.                 {
  17.                     _contact.Profession = value;
  18.                     NotifyPropertyChanged();
  19.                 }
  20.             }
  21.         }
  22.  
  23.         public string FullName
  24.         {
  25.             get { return string.Format("{0} {1}", _contact.FirstName, _contact.LastName); }
  26.         }
  27.  
  28.         public ContactViewModel(Contact contact)
  29.         {
  30.             _contact = contact;
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement