private GceStepViewModel(GceStepContent content)
        {
            _content = content;

            Instances = AsyncPropertyValueUtils.CreateAsyncProperty(GetAllWindowsInstances());

            ManageCredentialsCommand = new ProtectedCommand(OnManageCredentialsCommand, canExecuteCommand: false);
        }
        public UserAccountViewModel(UserAccount userAccount)
        {
            UserAccount = userAccount;

            AccountName = userAccount.AccountName;

            var dataSource = new GPlusDataSource(userAccount.GetGoogleCredential(), GoogleCloudExtensionPackage.VersionedApplicationName);
            var personTask = dataSource.GetProfileAsync();

            // TODO: Show the default image while it is being loaded.
            ProfilePictureAsync = AsyncPropertyValueUtils.CreateAsyncProperty(personTask, x => x.Image.Url);
            NameAsync           = AsyncPropertyValueUtils.CreateAsyncProperty(personTask, x => x.DisplayName, Resources.CloudExplorerLoadingMessage);
        }
Beispiel #3
0
 private void UpdateUserProfile()
 {
     if (_plusDataSource.Value != null)
     {
         var profileTask = _plusDataSource.Value.GetProfileAsync();
         ProfilePictureAsync = AsyncPropertyValueUtils.CreateAsyncProperty(profileTask, x => x.Image.Url);
         ProfileNameAsync    = AsyncPropertyValueUtils.CreateAsyncProperty(
             profileTask,
             x => x.Emails.FirstOrDefault()?.Value,
             Resources.CloudExplorerLoadingMessage);
     }
     else
     {
         ProfilePictureAsync = null;
         ProfileNameAsync    = new AsyncPropertyValue <string>(Resources.CloudExplorerSelectAccountMessage);
     }
 }