Class SfDatePicker
Represents a control that allows the user to select a date by using a drop-down Syncfusion.UI.Xaml.Controls.Input.DateSelector control.
Inheritance
Namespace: Syncfusion.Windows.Controls.Input
Assembly: Syncfusion.SfInput.Wpf.dll
Syntax
public class SfDatePicker : Control, IDataValidator, IDisposable
Remarks
Constructors
SfDatePicker()
Initializes a new instance of the Syncfusion.UI.Xaml.Controls.Input.DatePicker class.
Declaration
public SfDatePicker()
See Also
Fields
AccentBrushProperty
Using a DependencyProperty as the backing store for AccentBrush. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty AccentBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
AllowInlineEditingProperty
Using a DependencyProperty as the backing store for AllowInlineEditing. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty AllowInlineEditingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
AllowNullProperty
Using a DependencyProperty as the backing store for AllowNull. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty AllowNullProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
AutoForwardingProperty
Using a DependencyProperty as the backing store for AutoForwarding. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty AutoForwardingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
DateTimeProperty
Using a DependencyProperty as the backing store for SelectedDateTime. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty DateTimeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
DropDownHeightProperty
Using a DependencyProperty as the backing store for SelectorStyle. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty DropDownHeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
FormatStringProperty
Using a DependencyProperty as the backing store for FormatString. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty FormatStringProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
InputScopeProperty
Using a DependencyProperty as the backing store for InputScope. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty InputScopeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsDropDownOpenProperty
Using a DependencyProperty as the backing store for IsDropDownOpen. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty IsDropDownOpenProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MaxDateProperty
Using a DependencyProperty as the backing store for MaxDate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MaxDateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MinDateProperty
Using a DependencyProperty as the backing store for MinDate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MinDateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectorFormatStringProperty
Using a DependencyProperty as the backing store for ValueFormat. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectorFormatStringProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectorItemCountProperty
Using a DependencyProperty as the backing store for SelectorItemCount. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectorItemCountProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectorItemHeightProperty
Using a DependencyProperty as the backing store for SelectorItemHeight. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectorItemHeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectorItemSpacingProperty
Using a DependencyProperty as the backing store for SelectorItemSpacing. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectorItemSpacingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectorItemWidthProperty
Using a DependencyProperty as the backing store for SelectorItemWidth. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectorItemWidthProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectorStyleProperty
Using a DependencyProperty as the backing store for SelectorStyle. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectorStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SetValueOnLostFocusProperty
Using a DependencyProperty as the backing store for SetValueInLostFocus. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SetValueOnLostFocusProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ShowDropDownButtonProperty
Using a DependencyProperty as the backing store for ShowDropDownButton. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShowDropDownButtonProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ValueProperty
Using a DependencyProperty as the backing store for SelectedDateTime. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ValueProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
WatermarkProperty
Using a DependencyProperty as the backing store for Watermark. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty WatermarkProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
WatermarkTemplateProperty
Using a DependencyProperty as the backing store for WatermarkTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty WatermarkTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
AccentBrush
Gets or sets the background for Syncfusion.UI.Xaml.Controls.Input.DatePicker.
Declaration
public Brush AccentBrush { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | ba The default value is null. |
See Also
AllowInlineEditing
Returns a value when set
Declaration
public bool AllowInlineEditing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
AllowNull
Gets or sets the AllowNull for the Syncfusion.UI.Xaml.Controls.Input.SfDatePicker control.
Declaration
public bool AllowNull { get; set; }
Property Value
Type |
---|
System.Boolean |
AutoForwarding
Declaration
public bool AutoForwarding { get; set; }
Property Value
Type |
---|
System.Boolean |
DateTime
Gets or sets the DateTime value of the Syncfusion.UI.Xaml.Controls.Input.DatePicker control.
Declaration
public Nullable<DateTime> DateTime { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | The default value is null |
DropDownHeight
Gets or sets the height of the drop down for the Syncfusion.UI.Xaml.Controls.Input.DatePicker.
Declaration
public double DropDownHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is is zero. |
See Also
FormatString
Gets or sets the data that is used as a format for Syncfusion.UI.Xaml.Controls.Input.DatePicker.
Declaration
public string FormatString { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null. |
See Also
InputScope
Gets or sets the input scope
Declaration
public InputScopeNameValue InputScope { get; set; }
Property Value
Type |
---|
System.Windows.Input.InputScopeNameValue |
IsDropDownOpen
Gets or sets a value indicating whether the popup Syncfusion.UI.Xaml.Controls.Input.DateSelector drop down is open.
Declaration
public bool IsDropDownOpen { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
See Also
MaxDate
Gets or sets the Maximum number of dates to be listed in the Syncfusion.UI.Xaml.Controls.Input.DatePicker control.
Declaration
public DateTime MaxDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | The default value is DateTime.MaxValue |
MinDate
Gets or sets the Minimum number of dates to be listed in the Syncfusion.UI.Xaml.Controls.Input.DatePicker control.
Declaration
public DateTime MinDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | The default value is DateTime.MinValue |
SelectorFormatString
Gets or sets the SelectorFormatString for the Syncfusion.UI.Xaml.Controls.Input.DateSelector control.
Declaration
public object SelectorFormatString { get; set; }
Property Value
Type |
---|
System.Object |
SelectorItemCount
Gets or sets the SelectorItemCount for the date selector items
Declaration
public int SelectorItemCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 0 |
SelectorItemHeight
Gets or sets the SelectorItemHeight for the date selector items
Declaration
public double SelectorItemHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 70 |
SelectorItemSpacing
Gets or sets the SelectorItemSpacing for the date selector items
Declaration
public double SelectorItemSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 4 |
SelectorItemWidth
Gets or sets the SelectorItemWidth for the date selector items
Declaration
public double SelectorItemWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 80 |
SelectorStyle
Gets or sets the style that apply for the Syncfusion.UI.Xaml.Controls.Input.DateSelector.
Declaration
public Style SelectorStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Style | The default value is null |
SetValueOnLostFocus
Gets or sets a value indicating whether set Syncfusion.UI.Xaml.Controls.Input.DatePicker.Value on lost focus.
Declaration
public bool SetValueOnLostFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
See Also
ShowDropDownButton
Returns a value when set
Declaration
public bool ShowDropDownButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Value
Gets or sets the value of the Syncfusion.UI.Xaml.Controls.Input.DatePicker that hold the currently selected date.
Declaration
public Nullable<DateTime> Value { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | The default value is System.DateTime.Now. |
See Also
Watermark
Gets or sets the data used as WateMark
Declaration
public object Watermark { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null |
WatermarkTemplate
Gets or sets the template for the data used as WateMark
Declaration
public DataTemplate WatermarkTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.DataTemplate | The default value is null |
Methods
Dispose()
Unhooks all the events that are hooked
Declaration
public void Dispose()
OnAllowInlineEditing(DependencyPropertyChangedEventArgs)
Occurs when the instance of AllowInlineEditing is set true.
Declaration
protected virtual void OnAllowInlineEditing(DependencyPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | args |
OnApplyTemplate()
Initializes all the child elements of Syncfusion.UI.Xaml.Controls.Input.DatePicker control.
Declaration
public override void OnApplyTemplate()
OnFormatStringChanged(DependencyPropertyChangedEventArgs)
Occurs when the data used as FormatString has changed.
Declaration
protected virtual void OnFormatStringChanged(DependencyPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | args |
OnIsDropDownOpenChanged(DependencyPropertyChangedEventArgs)
Occurs when the instance of IsDropDownOpen is set true.
Declaration
protected virtual void OnIsDropDownOpenChanged(DependencyPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | args |
OnKeyDown(KeyEventArgs)
Occurs when the key is pressed
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Occurs when the pointer is released
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e |
OnMouseWheel(MouseWheelEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseWheelEventArgs | e | The System.Windows.Input.MouseWheelEventArgs that contains the event data. |
OnPreviewMouseLeftButtonDown(MouseButtonEventArgs)
Occurs when the left mouse button is pressed while the mouse pointer is over the element.
Declaration
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e |
OnSelectorFormatStringChanged(DependencyPropertyChangedEventArgs)
Occurs when the data used as SelectorFormatString has changed.
Declaration
protected virtual void OnSelectorFormatStringChanged(DependencyPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | args |
Validate(ValidationEventArgs)
/// Validates the states Syncfusion.UI.Xaml.Controls.Input.VisualStates
Declaration
public void Validate(ValidationEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.Schema.ValidationEventArgs | args |
Events
ValueChanged
Occurs when the value for Syncfusion.UI.Xaml.Controls.Input.DatePicker changed.
Declaration
public event PropertyChangedCallback ValueChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |