Example #1
0
        public ConnectionViewModel(IUserDialogs userDialogs,
                                   INavigationService navigationService,
                                   IAgentProvider agentProvider,
                                   IMessageService messageService,
                                   IDiscoveryService discoveryService,
                                   IConnectionService connectionService,
                                   IEventAggregator eventAggregator,
                                   ConnectionRecord record) : base(nameof(ConnectionsViewModel), userDialogs, navigationService)
        {
            _agentProvider     = agentProvider;
            _messageService    = messageService;
            _discoveryService  = discoveryService;
            _connectionService = connectionService;
            _eventAggregator   = eventAggregator;
            _record            = record;
            someMaterialColor  = new Helpers.SomeMaterialColor();

            MyDid              = _record.MyDid;
            TheirDid           = _record.TheirDid;
            ConnectionName     = _record.Alias.Name;
            ConnectionSubtitle = $"{_record.State:G}";
            Title              = "Connection Detail";
            if (this._connectionImageUrl == null)
            {
                _connectionImageUrl = $"https://ui-avatars.com/api/?name={_connectionName}&length=1&background={_organizeColor}&color=fff&size=128";
            }
            else
            {
                _connectionImageUrl = _record.Alias.ImageUrl;
            }
            if (_record.CreatedAtUtc != null)
            {
                _createdDate = (DateTime)_record.CreatedAtUtc;
            }
        }
        public CredentialViewModel(IUserDialogs userDialogs,
                                   INavigationService navigationService,
                                   CredentialRecord credential,
                                   IAgentProvider agentProvider,
                                   ICredentialService credentialService,
                                   IEventAggregator eventAggregator,
                                   IConnectionService connectionService) :
            base(nameof(CredentialViewModel), userDialogs, navigationService)
        {
            _connectionService = connectionService;
            _agentProvider     = agentProvider;
            _credentialService = credentialService;
            _eventAggregator   = eventAggregator;

            Title           = "Credential Detail";
            _credential     = credential;
            _attributes     = credential.CredentialAttributesValues;
            _credId         = _credential.Id;
            _state          = _credential.State;
            _credentialName = ConvertNameFromeSchemaId(_credential.SchemaId).ToTitleCase();
            if (_credential.CreatedAtUtc != null)
            {
                IssuedDate = (DateTime)_credential.CreatedAtUtc;
            }
            someMaterialColor = new Helpers.SomeMaterialColor();
        }