ArcGISWindowsPhoneSDK.TimeFeatureLayer.EndYearListBox_SelectionChanged C# (CSharp) Method

EndYearListBox_SelectionChanged() private method

private EndYearListBox_SelectionChanged ( object sender, System e ) : void
sender object
e System
return void
        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;
        }