Exemplo n.º 1
0
        public GoogleLoginService(IAccountService accountService, IAuthService authService)
        {
            _accountService = accountService;
            _authService    = authService;

            IsLoggingIn = _loggingInNotifier.ToReadOnlyReactivePropertySlim();
        }
Exemplo n.º 2
0
        public ItemService(IAccountService accountService)
        {
            _accountService = accountService;
            _firestore      = CrossCloudFirestore.Current.Instance;

            Item    = _item.ToReadOnlyReactivePropertySlim();
            Owner   = _owner.ToReadOnlyReactivePropertySlim();
            IsLiked = _isLiked.ToReadOnlyReactivePropertySlim();
            IsOwner = Observable.CombineLatest(Item, _accountService.UserId, (item, userId) => item != null && item.OwnerId == userId)
                      .ToReadOnlyReactivePropertySlim();
            IsLoaded   = _isLoaded.ToReadOnlyReactivePropertySlim();
            IsDeleting = _deletingNotifier.ToReadOnlyReactivePropertySlim();
        }
        public EmailLoginService(IAccountService accountService)
        {
            _accountService = accountService;

            CanLogin = new[]
            {
                Email.Select(s => !string.IsNullOrEmpty(s)),
                Password.Select(s => !string.IsNullOrEmpty(s))
            }
            .CombineLatestValuesAreAllTrue()
            .ToReadOnlyReactivePropertySlim();

            IsLoggingIn = _loggingInNotifier.ToReadOnlyReactivePropertySlim();
        }
        public SignupService(IAccountService accountService)
        {
            _accountService = accountService;

            CanSignup = new[]
            {
                Email.Select(s => !string.IsNullOrEmpty(s)),
                Name.Select(s => !string.IsNullOrEmpty(s)),
                Password.Select(s => !string.IsNullOrEmpty(s))
            }
            .CombineLatestValuesAreAllTrue()
            .ToReadOnlyReactivePropertySlim();

            IsSigningUp = _signingUpNotifier.ToReadOnlyReactivePropertySlim();
        }
Exemplo n.º 5
0
        public ContributionService(IAccountService accountService, IStorageService storageService)
        {
            _accountService = accountService;
            _storageService = storageService;
            _firestore      = CrossCloudFirestore.Current.Instance;

            CanContribute = new[]
            {
                ItemImage.Select(s => s != null),
                ItemTitle.Select(s => !string.IsNullOrEmpty(s)),
                _accountService.UserId.Select(s => !string.IsNullOrEmpty(s))
            }
            .CombineLatestValuesAreAllTrue()
            .ToReadOnlyReactivePropertySlim();

            IsContributing = _contributingNotifier.ToReadOnlyReactivePropertySlim();
        }