/// <summary> /// Constructor of the <see cref="ContactOutgoingSharedFolderViewModel"/> /// </summary> /// <param name="outShare">Folder outbound sharing with the contact</param> /// <param name="contactList">List that contains the contact</param> public ContactOutgoingSharedFolderViewModel(MShare outShare, ContactsListViewModel contactList) : base(SdkService.MegaSdk.getContact(outShare.getUser()), contactList) { this._outShare = outShare; this.AccessLevel = new AccessLevelViewModel(); this.GetAccesLevel(outShare); this.ChangePermissionsCommand = new RelayCommand <MShareType>(ChangePermissions); this.RemoveContactFromFolderCommand = new RelayCommand(RemoveContactFromFolder); }
public ContactViewModel(MUser contact, ContactsListViewModel contactList) : base(SdkService.MegaSdk) { this.MegaUser = contact; this.ContactList = contactList; this.Handle = contact.getHandle(); this.Email = contact.getEmail(); this.Timestamp = contact.getTimestamp(); this.Visibility = contact.getVisibility(); this.AvatarColor = UiService.GetColorFromHex(this.MegaSdk.getUserAvatarColor(contact)); this.SharedItems = new ContactSharedItemsViewModel(contact); this.RemoveContactCommand = new RelayCommand(RemoveContact); this.ViewProfileCommand = new RelayCommand(ViewProfile); }
public ContactViewModel(MUser contact, ContactsListViewModel contactList) : base(SdkService.MegaSdk) { this.MegaUser = contact; this.ContactList = contactList; if (contact != null) { this.Handle = contact.getHandle(); this.Email = contact.getEmail(); this.Timestamp = contact.getTimestamp(); this.Visibility = contact.getVisibility(); } else { LogService.Log(MLogLevel.LOG_LEVEL_WARNING, "'MUser' of contact is NULL"); } this.AvatarColor = UiService.GetColorFromHex(this.MegaSdk.getUserAvatarColor(contact)); this.SharedItems = new ContactSharedItemsViewModel(contact); this.RemoveContactCommand = new RelayCommand(RemoveContact); this.ViewProfileCommand = new RelayCommand(ViewProfile); }