Select to view content in your preferred language

control timeslider tickmark display

1198
2
01-07-2011 04:12 AM
JimHenry
Emerging Contributor
I have a lot of time steps in my timeslider.  I do not like the way it is displayed.  Is there a way to turn off just the tick marks?

<esri:TimeSlider x:Name="MyTimeSlider"
Loaded="MyTimeSlider_Loaded"
TimeMode="TimeInstant"
Height="20" 
MinimumValue="1997/1/1"
MaximumValue="1998/6/30"
Value="1997/1/1" />

List<DateTime> DateTimeMonths = new List<DateTime>();
DateTime dtStart = new DateTime(1997, 1, 1, 0, 0, 0, DateTimeKind.Utc);
myDate.DisplayDate = dtStart;
myDate.Text = dtStart.ToString("M/d/yyyy");
DateTime dtStep = dtStart;
DateTime dtEnd = new DateTime(1998, 6, 30, 18, 0, 0, DateTimeKind.Utc);
while (dtStep <= dtEnd)
{
    DateTimeMonths.Add(dtStep);
    dtStep = dtStep.AddHours(6);
}
MyTimeSlider.Intervals = DateTimeMonths;

[ATTACH]4177[/ATTACH]
0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor
You will have to override the default TimeSlider template and remove the TickMark control from it. To do so, in Expression Blend right-click the TimeSlider, select "Edit Template -> Edit a copy". Find the TickMark control in the template, and simply remove it.
0 Kudos
JimHenry
Emerging Contributor
Thanks that worked ... attached is the code that blend helped generate

<esri:TimeSlider x:Name="MyTimeSlider"
Loaded="MyTimeSlider_Loaded"
TimeMode="TimeInstant"
Height="20"
MinimumValue="1997/1/1"
MaximumValue="1998/6/30"
Value="1997/1/1"
Style="{StaticResource TimeSliderStyle1}" />

[ATTACH]4238[/ATTACH]
0 Kudos