Class TimeSlider
The TimeSlider is a utility Control that emits TimeExtent values typically for use with the Map Control to enhance the viewing of geographic features that have attributes based upon Date/Time information.
Namespace: Esri.ArcGISRuntime.Toolkit.UI.Controls
Assembly: Esri.ArcGISRuntime.Toolkit.WinUI.dll
Syntax
public class TimeSlider : Control
Constructors
| Improve this Doc View SourceTimeSlider()
Initializes a new instance of the TimeSlider class.
Declaration
public TimeSlider()
Fields
| Improve this Doc View SourceCurrentExtentFillProperty
Identifies the CurrentExtentFill dependency property.
Declaration
public static readonly DependencyProperty CurrentExtentFillProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CurrentExtentLabelColorProperty
Identifies the CurrentExtentLabelColor dependency property.
Declaration
public static readonly DependencyProperty CurrentExtentLabelColorProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CurrentExtentLabelFormatProperty
Identifies the CurrentExtentLabelFormat dependency property.
Declaration
public static readonly DependencyProperty CurrentExtentLabelFormatProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CurrentExtentProperty
Identifies the CurrentExtent dependency property.
Declaration
public static readonly DependencyProperty CurrentExtentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FullExtentFillProperty
Identifies the FullExtentFill dependency property.
Declaration
public static readonly DependencyProperty FullExtentFillProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FullExtentLabelColorProperty
Identifies the FullExtentLabelColor dependency property.
Declaration
public static readonly DependencyProperty FullExtentLabelColorProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FullExtentLabelFormatProperty
Identifies the FullExtentLabelFormat dependency property.
Declaration
public static readonly DependencyProperty FullExtentLabelFormatProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FullExtentProperty
Identifies the FullExtent dependency property.
Declaration
public static readonly DependencyProperty FullExtentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FullExtentStrokeProperty
Identifies the FullExtentStroke dependency property.
Declaration
public static readonly DependencyProperty FullExtentStrokeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsEndTimePinnedProperty
Identifies the IsEndTimePinned dependency property.
Declaration
public static readonly DependencyProperty IsEndTimePinnedProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsPlayingProperty
Identifies the IsPlaying dependency property.
Declaration
public static readonly DependencyProperty IsPlayingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsStartTimePinnedProperty
Identifies the IsStartTimePinned dependency property.
Declaration
public static readonly DependencyProperty IsStartTimePinnedProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
LabelModeProperty
Identifies the LabelMode dependency property.
Declaration
public static readonly DependencyProperty LabelModeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
LoopModeProperty
Identifies the PlaybackLoopMode dependency property.
Declaration
public static readonly DependencyProperty LoopModeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
PlaybackButtonsFillProperty
Identifies the PlaybackButtonsFill dependency property.
Declaration
public static readonly DependencyProperty PlaybackButtonsFillProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
PlaybackButtonsStrokeProperty
Identifies the PlaybackButtonsStroke dependency property.
Declaration
public static readonly DependencyProperty PlaybackButtonsStrokeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
PlaybackDirectionProperty
Identifies the PlaybackDirection dependency property.
Declaration
public static readonly DependencyProperty PlaybackDirectionProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
PlaybackIntervalProperty
Identifies the PlaybackInterval dependency property.
Declaration
public static readonly DependencyProperty PlaybackIntervalProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ThumbFillProperty
Identifies the ThumbFill dependency property.
Declaration
public static readonly DependencyProperty ThumbFillProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ThumbStrokeProperty
Identifies the ThumbStroke dependency property.
Declaration
public static readonly DependencyProperty ThumbStrokeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TimeStepIntervalLabelColorProperty
Identifies the TimeStepIntervalLabelColor dependency property.
Declaration
public static readonly DependencyProperty TimeStepIntervalLabelColorProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TimeStepIntervalLabelFormatProperty
Identifies the TimeStepIntervalLabelFormat dependency property.
Declaration
public static readonly DependencyProperty TimeStepIntervalLabelFormatProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TimeStepIntervalProperty
Identifies the TimeStepInterval dependency property.
Declaration
public static readonly DependencyProperty TimeStepIntervalProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TimeStepIntervalTickFillProperty
Identifies the TimeStepIntervalTickFill dependency property.
Declaration
public static readonly DependencyProperty TimeStepIntervalTickFillProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceCurrentExtent
Gets or sets the
Declaration
public TimeExtent? CurrentExtent { get; set; }
Property Value
Type | Description |
---|---|
Nullable<TimeExtent> |
CurrentExtentFill
Gets or sets the fill color of the area on the slider track that indicates the CurrentExtent.
Declaration
public Brush? CurrentExtentFill { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
CurrentExtentLabelColor
Gets or sets the color of the current extent labels.
Declaration
public Brush? CurrentExtentLabelColor { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
CurrentExtentLabelFormat
Gets or sets the string format to use for displaying the start and end labels for the CurrentExtent.
Declaration
public string CurrentExtentLabelFormat { get; set; }
Property Value
Type | Description |
---|---|
String |
FullExtent
Gets or sets the
Declaration
public TimeExtent? FullExtent { get; set; }
Property Value
Type | Description |
---|---|
Nullable<TimeExtent> |
FullExtentFill
Gets or sets the fill color of the area on the slider track that indicates the FullExtent.
Declaration
public Brush? FullExtentFill { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
FullExtentLabelColor
Gets or sets the color of the full extent labels.
Declaration
public Brush? FullExtentLabelColor { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
FullExtentLabelFormat
Gets or sets the string format to use for displaying the start and end labels for the FullExtent.
Declaration
public string FullExtentLabelFormat { get; set; }
Property Value
Type | Description |
---|---|
String |
FullExtentStroke
Gets or sets the border color of the area on the slider track that indicates the FullExtent.
Declaration
public Brush? FullExtentStroke { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
IsEndTimePinned
Gets or sets a value indicating whether the end time of the CurrentExtent is locked into place.
Declaration
public bool IsEndTimePinned { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsPlaying
Gets or sets a value indicating whether the time slider is animating playback.
Declaration
public bool IsPlaying { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsStartTimePinned
Gets or sets a value indicating whether the start time of the CurrentExtent is locked into place.
Declaration
public bool IsStartTimePinned { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
LabelMode
Gets or sets the mode to use for labels along the time slider.
Declaration
public TimeSliderLabelMode LabelMode { get; set; }
Property Value
Type | Description |
---|---|
TimeSliderLabelMode |
PlaybackButtonsFill
Gets or sets the fill color of the playback buttons.
Declaration
public Brush? PlaybackButtonsFill { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
PlaybackButtonsStroke
Gets or sets the border color of the playback buttons.
Declaration
public Brush? PlaybackButtonsStroke { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
PlaybackDirection
Gets or sets whether the current extent will move to the next or the previous time step during playback.
Declaration
public PlaybackDirection PlaybackDirection { get; set; }
Property Value
Type | Description |
---|---|
PlaybackDirection |
PlaybackInterval
Gets or sets the interval at which the time slider's current extent will move to the next or previous time step.
Declaration
public TimeSpan PlaybackInterval { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
PlaybackLoopMode
Gets or sets the behavior when the current extent reaches the end of the slider during playback.
Declaration
public LoopMode PlaybackLoopMode { get; set; }
Property Value
Type | Description |
---|---|
LoopMode |
ThumbFill
Gets or sets the fill color of the thumbs.
Declaration
public Brush? ThumbFill { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
ThumbStroke
Gets or sets the border color of the thumbs.
Declaration
public Brush? ThumbStroke { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
TimeStepInterval
Gets or sets the time step intervals for the time slider. The slider thumbs will snap to and tick marks will be shown at this interval.
Declaration
public TimeValue? TimeStepInterval { get; set; }
Property Value
Type | Description |
---|---|
Nullable<TimeValue> |
TimeStepIntervalLabelColor
Gets or sets the color of the time step interval labels.
Declaration
public Brush? TimeStepIntervalLabelColor { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
TimeStepIntervalLabelFormat
Gets or sets the string format to use for displaying the labels for the tick marks representing each time step interval.
Declaration
public string TimeStepIntervalLabelFormat { get; set; }
Property Value
Type | Description |
---|---|
String |
TimeStepIntervalTickFill
Gets or sets the color of the slider's tickmarks.
Declaration
public Brush? TimeStepIntervalTickFill { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Brush> |
TimeSteps
Gets the time steps that can be used to set the slider instance's current extent.
Declaration
public IReadOnlyList<DateTimeOffset> TimeSteps { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<DateTimeOffset> |
Methods
| Improve this Doc View SourceInitializeTimePropertiesAsync(ITimeAware)
Initializes the time slider's temporal properties based on the specified time-aware layer. Specifically, this will initialize FullExtent, TimeStepInterval, and CurrentExtent.
Declaration
public async Task InitializeTimePropertiesAsync(ITimeAware timeAwareLayer)
Parameters
Type | Name | Description |
---|---|---|
ITimeAware | timeAwareLayer | The layer to use to initialize the time slider. |
Returns
Type | Description |
---|---|
Task | Task. |
InitializeTimePropertiesAsync(Nullable<GeoView>)
Initializes the time slider's temporal properties based on the specified GeoView. Specifically, this will initialize FullExtent, TimeStepInterval, and CurrentExtent.
Declaration
public async Task InitializeTimePropertiesAsync(GeoView? geoView)
Parameters
Type | Name | Description |
---|---|---|
Nullable<GeoView> | geoView | The GeoView to use to initialize the time-slider's properties. |
Returns
Type | Description |
---|---|
Task | Task. |
InitializeTimeSteps(Int32)
Updates the time slider to have the specified number of time steps.
Declaration
public void InitializeTimeSteps(int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | The number of time steps. |
Remarks
This method divides the TimeSlider instance's FullExtent into the number of steps specified, updating the TimeStepInterval and TimeSteps properties. The method will attempt to set the interval to a TimeValue with the smallest duration and largest time unit that will fit evenly (i.e. without fractional duration values) into the TimeSlider's full extent. If there is no TimeValue that will fit evenly, then the interval will be initialized to the smallest possible fractional duration that is greater than one with a time unit of days or smaller.
Note that, if the TimeSlider instance's FullExtent property is not set, invoking this method will have no effect.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call Esri.ArcGISRuntime.
Declaration
protected override void OnApplyTemplate()
OnGotFocus(RoutedEventArgs)
Called before the Esri.ArcGISRuntime event occurs.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The data for the event. |
OnKeyDown(KeyRoutedEventArgs)
Called before the Esri.ArcGISRuntime event occurs.
Declaration
protected override void OnKeyDown(KeyRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyRoutedEventArgs | e | The data for the event. |
OnLostFocus(RoutedEventArgs)
Called before the Esri.ArcGISRuntime event occurs.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The data for the event. |
OnPointerEntered(PointerRoutedEventArgs)
Declaration
protected override void OnPointerEntered(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
PointerRoutedEventArgs | e |
OnPointerExited(PointerRoutedEventArgs)
Declaration
protected override void OnPointerExited(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
PointerRoutedEventArgs | e |
OnPointerPressed(PointerRoutedEventArgs)
Declaration
protected override void OnPointerPressed(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
PointerRoutedEventArgs | e |
StepBack(Int32)
Moves the slider position back by the specified number of time steps.
Declaration
public bool StepBack(int timeSteps = 1)
Parameters
Type | Name | Description |
---|---|---|
Int32 | timeSteps | The number of steps to advance the slider's position. |
Returns
Type | Description |
---|---|
Boolean |
|
Remarks
When the current time extent represents a time range and neither the start nor end time are pinned, then the number of time steps between the start and end time will always be preserved. In that case, a value of false will be returned if the extent could not be moved by the specified number of time steps without going beyond the start of the time slider's full extent. If the current time extent is a time instant and either the start or end time are pinned, then the method call will attempt to move the unpinned end of the time extent. In that case, the method will return false if the unpinned end could not be moved by the specified number of steps without going beyond the start of the full extent or the pinned end of the current extent. In all cases, when the method returns false, the time slider's current extent will be unchanged.
StepForward(Int32)
Moves the slider position forward by the specified number of time steps.
Declaration
public bool StepForward(int timeSteps = 1)
Parameters
Type | Name | Description |
---|---|---|
Int32 | timeSteps | The number of steps to advance the slider's position. |
Returns
Type | Description |
---|---|
Boolean |
|
Remarks
When the current time extent represents a time range and neither the start nor end time are pinned, then the number of time steps between the start and end time will always be preserved. In that case, a value of false will be returned if the extent could not be moved by the specified number of time steps without going beyond the end of the time slider's full extent. If the current time extent is a time instant and either the start or end time are pinned, then the method call will attempt to move the unpinned end of the time extent. In that case, the method will return false if the unpinned end could not be moved by the specified number of steps without going beyond the end of the full extent or the pinned end of the current extent. In all cases, when the method returns false, the time slider's current extent will be unchanged.
Events
| Improve this Doc View SourceCurrentExtentChanged
Occurs when the selected time extent has changed.
Declaration
public event EventHandler<TimeExtentChangedEventArgs> CurrentExtentChanged
Event Type
Type | Description |
---|---|
EventHandler<TimeExtentChangedEventArgs> |