private void EndYearListBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
ListBox yearCB = (ListBox)sender;
if (MyMap.TimeExtent.Start != new DateTime() && (DateTime)((sender as ListBox).Items[(sender as ListBox).SelectedIndex]) < MyMap.TimeExtent.Start)
{
MessageBox.Show("End year must be after start year.");
return;
}
MyMap.TimeExtent.End = (DateTime)(yearCB.Items[yearCB.SelectedIndex]);
(MyMap.Layers["EarthquakesLayer"] as FeatureLayer).Refresh();
EndYearChoicesPage.IsOpen = false;
}