public void ListFollowers()
{
this.Dispatch(() =>
{
TabItem ti = new TabItem();
StackPanel h = new StackPanel();
h.Orientation = Orientation.Horizontal;
TextBlock tx = new TextBlock { Text = String.Format(MessageHeaderUserFollowerFormat, ViewingUser.ScreenName) };
Button cl = new Button();
cl.Margin = new Thickness(2);
cl.Content = new TextBlock { FontFamily = new FontFamily("Marlett"), FontSize = 7, Text = "r" };
cl.Tag = ti;
cl.Click += cl_Click;
cl.Template = GetTemplate("FlatButton");
cl.Background = Brushes.LightGray;
h.Children.Add(tx);
h.Children.Add(cl);
ti.Header = h;
ListBox lb = new ListBox();
lb.SetValue(ScrollViewer.HorizontalScrollBarVisibilityProperty, ScrollBarVisibility.Auto);
lb.HorizontalContentAlignment = HorizontalAlignment.Stretch;
lb.SetValue(ScrollViewer.CanContentScrollProperty, false);
ti.Content = lb;
MainTab.Items.Add(ti);
MainTab.SelectedItem = ti;
Service.ListFollowers(new ListFollowersOptions { UserId = ViewingUser.Id, Count = (byte)ListFollowersCount }, (tl, res) =>
{
lb.Dispatch(() =>
{
//TwitterState.Dispatch(() => TwitterState.Content = res.ToString());
if (tl == null) return;
foreach (var u in tl)
{
lb.Items.Add(CreateUserPanel(u));
}
if (tl.NextCursor == 0) return;
Button morefw = new Button();
morefw.Content = "さらに表示";
morefw.Click += morefw_Click;
morefw.Tag = new FFInfo { Cursor = tl.NextCursor, User = ViewingUser, TargetListBox = lb };
lb.Items.Add(morefw);
});
});
});
}