示例#1
0
        /// <summary>
        /// Method for setting the display name to that of the one entered in the view
        /// </summary>
        public void SetDisplayName()
        {
            _currentDisplayName = _tempDisplayName;
            AccountHandler.Account.DisplayName = AccountHandler.DisplayNameAddTag(_tempDisplayName);
            AccountHandler.ChangeDisplayNameInAccountList(AccountHandler.Account.DisplayName);
            AccountHandler.AccountList.AddAccountToFile();
            AccountHandler.SetDisplayNameForUI = AccountHandler.Account.DisplayName;
            AccountHandler.MainPageVm?.CallForAccountStatus();
            IsSetDisplayNameEnabled = false;

            //Below saves the changed display name to the <username>.json file under /AccountDetails/
            AccountHandler.AccountDetail.DisplayName = AccountHandler.Account.DisplayName;
            AccountHandler.AccountDetail.CreateUserDetailsFile(AccountHandler.AccountDetail, AccountHandler.Account.UserName);
        }