public void RaiseEditSuccess(UserModel newUserSetting)
 {
     if (this.EditSuccess != null)
     {
         this.EditSuccess(this, new LoginSuccessArgs(newUserSetting));
     }
 }
 private void RaiseRegisterSuccess(UserModel registeredUser)
 {
     if(this.RegisterSuccess != null)
     {
         this.RegisterSuccess(this, new RegisterSuccessArgs(registeredUser));
     }
 }
 private void RaiseLoginSuccess(UserModel loggedUser)
 {
     if (this.LoginSuccess != null)
     {
         this.LoginSuccess(this, new LoginSuccessArgs(loggedUser));
     }
 }
        public ProfileViewModel(UserModel currentUserSettings)
        {
            this.CurrentUserSettings = currentUserSettings;
            this.Username = currentUserSettings.Username;
            this.LastName = currentUserSettings.LastName;
            this.FirstName = currentUserSettings.FirstName;
            this.ProfilePictureUrl = currentUserSettings.ProfilePictureUrl;

            OnPropertyChanged("Username");
            OnPropertyChanged("LastName");
            OnPropertyChanged("FirstName");
            OnPropertyChanged("ProfilePictureUrl");
        }
        public ViewUserProfileVewModel(UserModel selectedContact)
        {
            this.SelectedContact = selectedContact;
            this.Username = selectedContact.Username;
            this.LastName = selectedContact.LastName;
            this.FirstName = selectedContact.FirstName;
            this.ProfilePictureUrl = selectedContact.ProfilePictureUrl;

            OnPropertyChanged("Username");
            OnPropertyChanged("LastName");
            OnPropertyChanged("FirstName");
            OnPropertyChanged("ProfilePictureUrl");
        }
        public ConversationViewModel(ConversationModel conversation, UserModel currentUser, UserModel partner)
        {
            this.CurrentConversation = conversation;
            this.CurrentUserInfo = currentUser;
            this.Partner = partner;
            this.CurrentConversation.Messages =
                MessagePersister.GetAllMsgsByConversation(CurrentUserInfo.SessionKey,
                                                            CurrentConversation.Id);

            OnPropertyChanged("CurrentConversation");

            pubnub = new PubnubAPI(PUBLISH_KEY, SUBSCRIBE_KEY, SECRET_KEY, true);

            var minId = Math.Min(CurrentUserInfo.Id, Partner.Id);
            var maxId = Math.Max(CurrentUserInfo.Id, Partner.Id);
            channelName = string.Format("channel-{0}-{1}",
                                               minId, maxId);

            Thread t = new Thread(() =>
                                  pubnub.Subscribe(channelName, HandleNewMessageReceived));
            t.IsBackground = true;
            t.Start();
        }
 public ViewContactProfileArgs(UserModel userSettings)
     : base()
 {
     this.ContactInfo = userSettings;
 }
 public RegisterSuccessArgs(UserModel user) : base()
 {
     this.RegisteredUser = user;
 }
 public GeneralViewModel(UserModel currentUser)
 {
     this.CurrentUser = currentUser;
     ReloadContacts();
     this.FoundContacts = new List<UserModel>(this.Contacts);
 }
 public LoginSuccessArgs(UserModel userSettings)
     : base()
 {
     this.UserSetting = userSettings;
 }