Example #1
0
        /// <summary>
        /// 自身のフォローを取得する
        /// </summary>
        private async void SetUsers()
        {
            this.ExtraGrid.Clear();
            this.ExtraGrid.Add(new Grid());

            var users = await AccountTokens.LoadFriendsAsync(this.TokenSuffix);

            var itemsSource = new ObservableCollection <UserProperties>();

            BindingOperations.EnableCollectionSynchronization(itemsSource, new object());

            foreach (var user in users)
            {
                if (user.Id != null)
                {
                    itemsSource.Add(new UserProperties(this)
                    {
                        Name                 = user.Name,
                        ScreenName           = user.ScreenName,
                        Description          = user.Description,
                        ProfileImageUrlHttps = user.ProfileImageUrlHttps,
                        Id = (long)user.Id
                    });
                }
            }

            this.ExtraGrid.First().Children.Add(
                new Views.MainWindows.Flyouts.ExtraGrid.Users()
            {
                DataContext = new UsersModel(this, itemsSource, this.TokenSuffix)
            }
                );
        }