private void ReloadNews(object sender, BaseEventArgs e)
{
if (!this.Dispatcher.CheckAccess()) {
this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new BaseEventHandler((s, e2) => {
ReloadNews(sender, e2);
}), sender, e);
return;
}
Profile currentProfile = ProfileManager.CurrentProfile;
string currentUrl = string.Format(URLUtils.TWITTER_PROXY, currentProfile.News.TwitterUser);
if (_jsonUrl != currentUrl) {
_jsonUrl = currentUrl;
}
ServerVM.UnLoadData();
ServerNews.Clear();
TwitterVM.UnLoadData();
bool newsSupported = ConfigurationManager.GetConfiguration(ProfileManager.CurrentProfile.GameModel).IsNewsAvailable;
NavServer.Visibility = newsSupported ? Visibility.Visible : Visibility.Hidden;
NavTwitter.Visibility = newsSupported ? Visibility.Visible : Visibility.Hidden;
byte index = newsSupported ? currentProfile.News.FirstTab : (byte)0;
NewsTabControl.SelectedIndex = index;
ShowTab(index);
}