Ejemplo n.º 1
0
 public HomeViewModel(IUserDialogs userDialogs,
                      INavigationService navigationService,
                      IConnectionService connectionService,
                      ICredentialService credentialService,
                      ICredentialAssembler credentialAssembler,
                      IProofAssembler proofAssembler,
                      IRequestPresentationFiller requestPresentationFiller,
                      IConnectionAssembler connectionAssembler,
                      IProofService proofService,
                      IWalletRecordService recordService,
                      IAgentProvider agentContextProvider,
                      IEventAggregator eventAggregator,
                      ILifetimeScope scope) : base(AppResources.HomeTabTitle, userDialogs, navigationService)
 {
     _connectionService         = connectionService;
     _credentialService         = credentialService;
     _credentialAssembler       = credentialAssembler;
     _connectionAssembler       = connectionAssembler;
     _proofAssembler            = proofAssembler;
     _proofService              = proofService;
     _requestPresentationFiller = requestPresentationFiller;
     _recordService             = recordService;
     _agentContextProvider      = agentContextProvider;
     _eventAggregator           = eventAggregator;
     _scope             = scope;
     _userDialogs       = userDialogs;
     _navigationService = navigationService;
 }
        public ProofRequestsViewModel(
            IUserDialogs userDialogs,
            INavigationService navigationService,
            IProofService proofService,
            ICredentialService credentialService,
            IAgentProvider agentContextProvider,
            IWalletRecordService recordService,
            IEventAggregator eventAggregator,
            IProofAssembler proofAssembler,
            IRequestPresentationFiller requestPresentationFiller,
            ILifetimeScope scope
            ) : base(
                AppResources.ProofsPageTitle,
                userDialogs,
                navigationService
                )
        {
            _proofService         = proofService;
            _agentContextProvider = agentContextProvider;
            _scope                     = scope;
            _eventAggregator           = eventAggregator;
            _recordService             = recordService;
            _credentialService         = credentialService;
            _proofAssembler            = proofAssembler;
            _requestPresentationFiller = requestPresentationFiller;

            this.WhenAnyValue(x => x.SearchTerm)
            .Throttle(TimeSpan.FromMilliseconds(200))
            .InvokeCommand(RefreshCommand);
        }
Ejemplo n.º 3
0
        public MainViewModel(
            IUserDialogs userDialogs,
            INavigationService navigationService,
            HomeViewModel homeViewModel,
            MessagesViewModel messagesViewModel,
            IAgentProvider agentContextProvider,
            ConnectionsViewModel connectionsViewModel,
            CredentialsViewModel credentialsViewModel,
            IEventAggregator eventAggregator,
            IProofService proofService,
            IProofAssembler proofAssembler,
            IWalletRecordService recordService,
            IRequestPresentationFiller requestPresentationFiller,
            AccountViewModel accountViewModel,
            ProofRequestsViewModel proofRequestsViewModel,
            CreateInvitationViewModel createInvitationViewModel
            ) : base(
                nameof(MainViewModel),
                userDialogs,
                navigationService
                )
        {
            Home                       = homeViewModel;
            Messages                   = messagesViewModel;
            Connections                = connectionsViewModel;
            Credentials                = credentialsViewModel;
            Account                    = accountViewModel;
            ProofRequests              = proofRequestsViewModel;
            CreateInvitation           = createInvitationViewModel;
            _eventAggregator           = eventAggregator;
            _proofService              = proofService;
            _recordService             = recordService;
            _agentContextProvider      = agentContextProvider;
            _requestPresentationFiller = requestPresentationFiller;
            _proofAssembler            = proofAssembler;
            MessagingCenter.Subscribe <object>(this, "ScanInvite", async(sender) =>
            {
                await ScanInvite();
            });

            _subscription = _eventAggregator.GetEventByType <ServiceMessageProcessingEvent>()
                            .Where(x => x.MessageType == MessageTypes.PresentProofNames.RequestPresentation || x.MessageType == "https://didcomm.org/present-proof/1.0/request-presentation")
                            .Subscribe(async x =>
            {
                await DisplayRequestPresentation(x.RecordId);
            });
        }