Interface IDateTimeElement
DateTime elements
Namespace: Syncfusion.Maui.Sliders
Assembly: Syncfusion.Maui.Sliders.dll
Syntax
public interface IDateTimeElement
Properties
DateFormat
Gets or sets the value to format the date labels.
Declaration
string DateFormat { get; set; }
Property Value
Type | Description |
---|---|
System.String | Defaults to |
Examples
Snippet for SfDateTimeSlider #XAML
<sliders:SfDateTimeSlider Minimum = "2010-1-1"
Maximum = "2011-1-1"
Value = "2010-4-1"
ShowLabels = "True"
DateFormat = "M yyyy" />
SfDateTimeSlider slider = new SfDateTimeSlider()
{
Minimum = new DateTime(2010, 1, 1),
Maximum = new DateTime(2011, 1, 1),
Value = new DateTime(2010, 4, 1),
ShowLabels = true,
DateFormat = "M yyyy"
};
Snippet for SfDateTimeRangeSlider #XAML
<sliders:SfDateTimeRangeSlider Minimum = "2010-1-1"
Maximum = "2011-1-1"
RangeStart = "2010-4-1"
RangeEnd = "2010-9-1"
ShowLabels = "True"
DateFormat = "M yyyy" />
SfDateTimeRangeSlider rangeSlider = new SfDateTimeRangeSlider()
{
Minimum = new DateTime(2010, 1, 1),
Maximum = new DateTime(2011, 1, 1),
RangeStart = new DateTime(2010, 4, 1),
RangeEnd = new DateTime(2010, 9, 1),
ShowLabels = true,
DateFormat = "M yyyy"
};
Snippet for SfRangeSelector
SfDateTimeRangeSelector rangeSelector = new SfDateTimeRangeSelector()
{
Minimum = new DateTime(2010, 1, 1),
Maximum = new DateTime(2011, 1, 1),
RangeStart = new DateTime(2010, 4, 1),
RangeEnd = new DateTime(2010, 9, 1),
ShowLabels = true,
DateFormat = "M yyyy"
};
IntervalType
Gets or sets the type of the date interval.
Declaration
SliderDateIntervalType IntervalType { get; set; }
Property Value
Type | Description |
---|---|
SliderDateIntervalType | Defaults to |
Examples
/// Snippet for SfDateTimeSlider
<sliders:SfDateTimeSlider Minimum = "2010-1-1"
Maximum = "2011-1-1"
Value = "2010-5-1"
IntervalType="Months"/>
Snippet for SfDateTimeRangeSlider
<sliders:SfDateTimeRangeSlider Minimum = "2010-1-1"
Maximum = "2011-1-1"
Value = "2010-5-1"
IntervalType="Months"/>
Snippet for SfDateTimeRangeSelector
<sliders:SfDateTimeRangeSelector Minimum = "2010-1-1"
Maximum = "2011-1-1"
Value = "2010-5-1"
IntervalType="Months"/>
StepDuration
Gets or set the value indication whether to select the discrete date value.
StepDuration doesnt work with BetweenThumbs.
For example, if Minimum is System.DateTime(2015, 01, 01) and Maximum is System.DateTime(2020, 01, 01) and StepDuration is SliderStepDuration(Years: 1, Months: 6), the slider will move the thumb at System.DateTime(2015, 01, 01), System.DateTime(2016, 07, 01), System.DateTime(2018, 01, 01),and System.DateTime(2019, 07, 01).
Declaration
SliderStepDuration StepDuration { get; set; }
Property Value
Type | Description |
---|---|
SliderStepDuration | Defaults to |
Examples
Snippet for SfDateTimeSlider
<sliders:SfDateTimeSlider Minimum="2010-01-01"
Maximum="2015-01-01"
Value="2012-1-1"
StepDuration="5">
</sliders:SfDateTimeSlider>
Snippet for SfDateTimeRangeSlider
<sliders:SfDateTimeRangeSlider Minimum="2010-01-01"
Maximum="2015-01-01"
RangeStart="2012-01-01"
RangeEnd="2016-01-01"
StepDuration="5">
</sliders:SfDateTimeRangeSlider>
Snippet for SfDateTimeRangeSelector
<sliders:SfDateTimeRangeSelector Minimum="2010-01-01"
Maximum="2015-01-01"
RangeStart="2012-01-01"
RangeEnd="2016-01-01"
StepDuration="5">
</sliders:SfDateTimeRangeSelector>
Methods
OnDateFormatChanged(String, String)
Call when date format has changed.
Declaration
void OnDateFormatChanged(string oldValue, string newValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | oldValue | |
System.String | newValue |
OnIntervalTypeChanged(SliderDateIntervalType, SliderDateIntervalType)
Call when interval type has changed.
Declaration
void OnIntervalTypeChanged(SliderDateIntervalType oldValue, SliderDateIntervalType newValue)
Parameters
Type | Name | Description |
---|---|---|
SliderDateIntervalType | oldValue | |
SliderDateIntervalType | newValue |
OnStepChanged()
Call when step duration has changed.
Declaration
void OnStepChanged()