Example #1
0
 public AccountViewModel()
 {
     CheckLogin();
     MessagingCenter.Subscribe <LoginViewModel>(this, "CheckLogin",
                                                (sender) => CheckLogin());
     MessagingCenter.Subscribe <RegisterViewModel>(this, "CheckLogin",
                                                   (sender) => CheckLogin());
     MessagingCenter.Subscribe <EditAccountViewModel>(this, "UpdateAccount",
                                                      (sender) => LoadUserCommand.Execute(null));
 }
Example #2
0
        public async Task <CommandResult> Load([FromServices] LoadUserCommand _loadUserCommand, string siteId, string siteUserId)
        {
            var userInput = new UserInput <LoadUserInput>
            {
                UserId = User.GetUserId(),
                Data   = new LoadUserInput
                {
                    SiteId     = siteId,
                    SiteUserId = siteUserId
                }
            };

            var result = await
                         Business
                         .InvokeAsync <LoadUserCommand, UserInput <LoadUserInput>, CommandResult <dynamic> >(_loadUserCommand,
                                                                                                             userInput).ConfigureAwait(false);

            return(result);
        }