Inheritance: INotifyPropertyChanged
 private void HandleContactClicked(UserViewModel uvm)
 {
 }
        internal static UserViewModel MergeFromComputerIA(ComputerIA u)
        {
            UserViewModel userViewModel = new UserViewModel();
            userViewModel.id = u.Id.ToString();
            userViewModel.Name = u.Name;
            userViewModel.JobTitle = u.JobTitle;
            userViewModel.Email = u.Email;
            userViewModel.photoUri = u.PictureUri;

            var folder = ApplicationData.Current.LocalFolder;
            BitmapImage photo = new BitmapImage(userViewModel.photoUri);

            userViewModel.Photo = (ImageSource) photo;
            userViewModel.IsLoadedPhoto = true;

            return userViewModel;
        }
        internal static UserViewModel GetUser(string userPrincipalName)
        {
            userPrincipalName = userPrincipalName.Trim();
            try
            {
                if (string.IsNullOrEmpty(userPrincipalName))
                    return UserViewModel.Empty;
                UserViewModel user = users.FirstOrDefault(u => u.Email == userPrincipalName || u.UserPrincipalName == userPrincipalName);
                if (user != null)
                    return user;
                user = new UserViewModel()
                {
                    Email = userPrincipalName,
                    UserPrincipalName = userPrincipalName,
                    IsLoadedFromGraph = false,
                };

                users.Add(user);
                return user;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw;
            }
        }
        internal static UserViewModel MergeFromSharepoint(UserViewModel userViewModel, SPItemUser u)
        {
            userViewModel.DocId = u.DocId;
            userViewModel.Department = u.Department;
            userViewModel.JobTitle = u.JobTitle;
            userViewModel.Path = u.Path;
            userViewModel.WorkEmail = u.WorkEmail;
            if (!String.IsNullOrEmpty(u.PictureUrl))
                userViewModel.SPPictureUrl = new BitmapImage(new Uri(u.PictureUrl));
            else
                userViewModel.SPPictureUrl = ImageHelper.UnknownPersonImage;

            userViewModel.Name = u.PreferredName;
            userViewModel.FirstName = u.FirstName;

            if (string.IsNullOrEmpty(userViewModel.UserPrincipalName))
                userViewModel.UserPrincipalName = u.UserName.Trim();

            userViewModel.IsLoadedFromSharePoint = true;

            return userViewModel;
        }
 static UserViewModel()
 {
     empty = new UserViewModel();
     empty.IsLoadedFromGraph = true;
     empty.IsLoadedFromSharePoint = true;
     uiScheduler = TaskScheduler.FromCurrentSynchronizationContext();
 }