Пример #1
0
        public override async Task DidLoad()
        {
            await base.DidLoad();

            IsTwitterSelected = await _twitterHelper.AccountExists();

            IsFacebookSelected = await _facebookHelper.AccountExists();

            await RequestCanExecute();
        }
Пример #2
0
        private async Task AddTwitter()
        {
            var newVM      = new TwitterMenuItemViewModel(OnListItemSelected);
            var existingVM = await TryAdd(newVM);

            var exists = await _twitterHelper.AccountExists();

            existingVM.MenuItemType = exists ? MenuItemType.Added : MenuItemType.Add;
        }
Пример #3
0
        private async Task GetTwitterUserAccountDetails()
        {
            // Sync twitter account details
            if (await _twitterHelper.AccountExists())
            {
                var account = _twitterHelper.GetAccount();

                if (!account.Properties.ContainsKey("imageUrl"))
                {
                    var twitterResponse = await _twitterService.GetUser(account.Username);

                    if (await ProcessResponse(twitterResponse, false))
                    {
                        var user = twitterResponse.Result;

                        account.Properties ["name"]     = user.Name;
                        account.Properties ["id"]       = user.Id;
                        account.Properties ["imageUrl"] = user.Picture;

                        _twitterHelper.Synchronize(account);
                    }
                }
            }
        }