private void SetUserStates(UserStateKind state)
{
FollowType = state;
switch (state)
{
case UserStateKind.Me:
UserState.Dispatcher.BeginInvoke(new Action(() =>
{
UserState.Text = MessageStateYou;
}));
FollowButton.Dispatcher.BeginInvoke(new Action(() =>
{
FollowButton.Background = Brushes.Gray;
}));
FollowState.Dispatcher.BeginInvoke(new Action(() =>
{
FollowState.Text = MessageFollowButtonYou;
FollowState.Foreground = Brushes.Black;
}));
break;
case UserStateKind.Blocking:
UserState.Dispatcher.BeginInvoke(new Action(() =>
{
UserState.Text = MessageStateBlocking;
}));
FollowButton.Dispatcher.BeginInvoke(new Action(() =>
{
FollowButton.Background = Brushes.DarkBlue;
}));
FollowState.Dispatcher.BeginInvoke(new Action(() =>
{
FollowState.Text = MessageFollowButtonUnblock;
FollowState.Foreground = Brushes.White;
}));
break;
case UserStateKind.Blocked:
UserState.Dispatcher.BeginInvoke(new Action(() =>
{
UserState.Text = MessageStateBlocked;
}));
FollowButton.Dispatcher.BeginInvoke(new Action(() =>
{
FollowButton.Background = Brushes.Red;
}));
FollowState.Dispatcher.BeginInvoke(new Action(() =>
{
FollowState.Text = MessageFollowButtonCantFollow;
FollowState.Foreground = Brushes.White;
}));
break;
case UserStateKind.Following:
UserState.Dispatcher.BeginInvoke(new Action(() =>
{
UserState.Text = MessageStateFollowing;
}));
FollowButton.Dispatcher.BeginInvoke(new Action(() =>
{
FollowButton.Background = Brushes.Yellow;
}));
FollowState.Dispatcher.BeginInvoke(new Action(() =>
{
FollowState.Text = MessageFollowButtonUnfollow;
FollowState.Foreground = Brushes.Black;
}));
break;
case UserStateKind.Followed:
UserState.Dispatcher.BeginInvoke(new Action(() =>
{
UserState.Text = MessageStateFollowed;
}));
FollowButton.Dispatcher.BeginInvoke(new Action(() =>
{
FollowButton.Background = Brushes.LightBlue;
}));
FollowState.Dispatcher.BeginInvoke(new Action(() =>
{
FollowState.Text = MessageFollowButtonFollow;
FollowState.Foreground = Brushes.Black;
}));
break;
case UserStateKind.FFed:
UserState.Dispatcher.BeginInvoke(new Action(() =>
{
UserState.Text = MessageStateFFed;
}));
FollowButton.Dispatcher.BeginInvoke(new Action(() =>
{
FollowButton.Background = Brushes.Yellow;
}));
FollowState.Dispatcher.BeginInvoke(new Action(() =>
{
FollowState.Text = MessageFollowButtonUnfollow;
FollowState.Foreground = Brushes.Black;
}));
break;
case UserStateKind.None:
UserState.Dispatcher.BeginInvoke(new Action(() =>
{
UserState.Text = MessageStateNone;
}));
FollowButton.Dispatcher.BeginInvoke(new Action(() =>
{
FollowButton.Background = Brushes.LightBlue;
}));
FollowState.Dispatcher.BeginInvoke(new Action(() =>
{
FollowState.Text = MessageFollowButtonFollow;
FollowState.Foreground = Brushes.Black;
}));
break;
default:
break;
}
}