Пример #1
0
 public WalletCreationViewModel(
     INavigationService navigationService,
     IPoolConfigurator poolConfigurator,
     IEdgeProvisioningService edgeProvisioningService
     )
     : base("Wallet Creation", navigationService)
 {
     _edgeProvisioningService = edgeProvisioningService;
     _poolConfigurator        = poolConfigurator;
 }
Пример #2
0
 public RegisterViewModel(
     IUserDialogs userDialogs,
     INavigationService navigationService,
     IAgentProvider agentProvider,
     IPoolConfigurator poolConfigurator,
     IEdgeProvisioningService provisioningService) : base(
         nameof(RegisterViewModel),
         userDialogs,
         navigationService)
 {
     _agentContextProvider = agentProvider;
     _poolConfigurator     = poolConfigurator;
     _provisioningService  = provisioningService;
 }
        public CredentialViewModel(
            IUserDialogs userDialogs,
            INavigationService navigationService,
            IAgentProvider agentContextProvider,
            ICredentialService credentialService,
            IEventAggregator eventAggregator,
            IMessageService messageService,
            IPoolConfigurator poolConfigurator,
            IConnectionService connectionService,
            CredentialRecord credential
            ) : base(
                "Credential Details",
                userDialogs,
                navigationService
                )
        {
            _credential           = credential;
            _agentContextProvider = agentContextProvider;
            _credentialService    = credentialService;
            _eventAggregator      = eventAggregator;
            _messageService       = messageService;
            _connectionService    = connectionService;
            _isNew            = IsCredentialNew(_credential);
            _poolConfigurator = poolConfigurator;

            if (credential.State == CredentialState.Offered)
            {
                IsPending         = true;
                AreButtonsVisible = true;
            }

            if (credential.State == CredentialState.Issued)
            {
                IsIssued          = true;
                AreButtonsVisible = false;
                if (credential.CredentialAttributesValues != null)
                {
                    Attributes = credential.CredentialAttributesValues
                                 .Select(p =>
                                         new CredentialAttribute()
                    {
                        Name  = p.Name,
                        Value = p.Value?.ToString(),
                        Type  = p.Value != null && (p.Value.ToString().StartsWith("data:image/jpeg;base64") || p.Value.ToString().StartsWith("data:image/png;base64")) ? "Image" : "Text",
                        Image = p.Value != null && (p.Value.ToString().StartsWith("data:image/jpeg;base64") || p.Value.ToString().StartsWith("data:image/png;base64")) ? ImageSource.FromStream(() => new MemoryStream(Convert.FromBase64String(p.Value.ToString().Replace("data:image/jpeg;base64,", "").Replace("data:image/png;base64,", "")))) : null
                    })
                                 .ToList();
                }
            }
        }
Пример #4
0
 public MainViewModel(
     IUserDialogs userDialogs,
     INavigationService navigationService,
     ConnectionsViewModel connectionsViewModel,
     CredentialsViewModel credentialsViewModel,
     AccountViewModel accountViewModel,
     CreateInvitationViewModel createInvitationViewModel,
     IPoolConfigurator _poolConfigurator,
     ProofRequestsViewModel proofRequestsViewModel) : base(nameof(MainViewModel), userDialogs, navigationService)
 {
     Connections      = connectionsViewModel;
     Credentials      = credentialsViewModel;
     Account          = accountViewModel;
     CreateInvitation = createInvitationViewModel;
     ProofRequests    = proofRequestsViewModel;
     poolConfigurator = _poolConfigurator;
 }
 public RegisterViewModel(
     IUserDialogs userDialogs,
     INavigationService navigationService,
     IAgentProvider agentProvider,
     IPoolConfigurator poolConfigurator,
     ILifetimeScope scope,
     IOptions <AgentOptions> agentOptions,
     IProvisioningService provisioningService,
     IEdgeProvisioningService edgeProvisioningService) : base(
         nameof(RegisterViewModel),
         userDialogs,
         navigationService)
 {
     _agentContextProvider    = agentProvider;
     _poolConfigurator        = poolConfigurator;
     _provisioningService     = provisioningService;
     _edgeProvisioningService = edgeProvisioningService;
     _agentOptions            = agentOptions.Value;
     _scope = scope;
 }