I think I eventually got it 🙂One option is to set the Map TimeExtent by code instead of by binding. So by code you can expand the TimeExtent until 1520.Hook up an handler to ValueChanged event of your time slider and define your handler this way:private void MyTimeSlider_ValueChanged(object sender, TimeSlider.ValueChangedEventArgs e) { var startDate = new DateTime(1520, 1, 1); var endDate = e.NewValue.End; MyMap.TimeExtent = new TimeExtent(startDate, endDate); }Another option is to keep a binding with a converter expanding the time extent as above (for MVVM addict).
private void MyTimeSlider_ValueChanged(object sender, TimeSlider.ValueChangedEventArgs e) { var startDate = new DateTime(1520, 1, 1); var endDate = e.NewValue.End; MyMap.TimeExtent = new TimeExtent(startDate, endDate); }
//Setting up interval for pre 1774-1786 portion of slider DateTime myMinDate_Pre = MyTimeSlider.MinimumValue; DateTime myMaxDate_Pre = DateTime.Parse("1773-12-31T00:00:00.0000000Z", CultureInfo.CurrentCulture, DateTimeStyles.AdjustToUniversal); TimeExtent myTimeExtent_Pre = new TimeExtent(myMinDate_Pre, myMaxDate_Pre); TimeSpan myTimeSpan_Pre = new TimeSpan(3650, 0, 0, 0); //Setting up interval for 1774-1786 portion of slider DateTime myMinDate_Range = DateTime.Parse("1774-01-01T00:00:00.0000000Z", CultureInfo.CurrentCulture, DateTimeStyles.AdjustToUniversal); DateTime myMaxDate_Range = DateTime.Parse("1786-12-31T00:00:00.0000000Z", CultureInfo.CurrentCulture, DateTimeStyles.AdjustToUniversal); TimeExtent myTimeExtent_Range = new TimeExtent(myMinDate_Range, myMaxDate_Range); TimeSpan myTimeSpan_Range = new TimeSpan(180, 0, 0, 0); //Setting up interval for post 1774-1786 portion of slider DateTime myMinDate_Post = DateTime.Parse("1787-01-01T00:00:00.0000000Z", CultureInfo.CurrentCulture, DateTimeStyles.AdjustToUniversal); DateTime myMaxDate_Post = DateTime.Parse("1848-12-31T00:00:00.0000000Z", CultureInfo.CurrentCulture, DateTimeStyles.AdjustToUniversal); TimeExtent myTimeExtent_Post = new TimeExtent(myMinDate_Post, myMaxDate_Post); TimeSpan myTimeSpan_Post = new TimeSpan(730, 0, 0, 0); //Creating Date Collection //Creating IEnumerables IEnumerable<DateTime> myIEnum_Pre = null; IEnumerable<DateTime> myIEnum_Range = null; IEnumerable<DateTime> myIEnum_Post = null; IEnumerable<DateTime> myIEnum_Comb = null; //Loading Dates into IEnumerables myIEnum_Pre = TimeSlider.CreateTimeStopsByTimeInterval(myTimeExtent_Pre, myTimeSpan_Pre); myIEnum_Range = TimeSlider.CreateTimeStopsByTimeInterval(myTimeExtent_Range, myTimeSpan_Range); myIEnum_Post = TimeSlider.CreateTimeStopsByTimeInterval(myTimeExtent_Post, myTimeSpan_Post); //Creating Lists List<DateTime> myIntervalList_Pre = new List<DateTime>(); List<DateTime> myIntervalList_Range = new List<DateTime>(); List<DateTime> myIntervalList_Post = new List<DateTime>(); //Converting IEnumerables to Lists myIntervalList_Pre = myIEnum_Pre.ToList(); myIntervalList_Range = myIEnum_Range.ToList(); myIntervalList_Post = myIEnum_Post.ToList(); //Combining Lists List<DateTime> myIntervalList_Comb = new List<DateTime>(); myIntervalList_Comb.AddRange(myIntervalList_Pre); myIntervalList_Comb.AddRange(myIntervalList_Range); myIntervalList_Comb.AddRange(myIntervalList_Post); //Convering Combined List to IEnumerable myIEnum_Comb = myIntervalList_Comb; //Set intervals to show collection MyTimeSlider.Intervals = myIEnum_Comb;
If you want to get a time slider going from year 1774 to year 1786, set the MinimumValue and MaximumValue of your time slider to these years: <esri:TimeSlider MinumumValue="01/01/1774" MaximumValue="01/01/1786" ....
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.