C# Класс Microsoft.Samples.KMoore.WPFSamples.DateControls.DatePicker

Наследование: System.Windows.Controls.Control
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
CanEditProperty System.Windows.DependencyProperty
DateConverterProperty System.Windows.DependencyProperty
DropDownButtonStyleProperty System.Windows.DependencyProperty
DropDownClosedEvent System.Windows.RoutedEvent
DropDownOpenedEvent System.Windows.RoutedEvent
InvalidEntryEvent System.Windows.RoutedEvent
IsDropDownOpenProperty System.Windows.DependencyProperty
IsReadOnlyProperty System.Windows.DependencyProperty
IsValidProperty System.Windows.DependencyProperty
MaxDateProperty System.Windows.DependencyProperty
MinDateProperty System.Windows.DependencyProperty
MonthCalendarStyleProperty System.Windows.DependencyProperty
NullValueTextProperty System.Windows.DependencyProperty
TextProperty System.Windows.DependencyProperty
ValueChangedEvent System.Windows.RoutedEvent
ValueProperty System.Windows.DependencyProperty

Private Properties

Свойство Тип Описание
AttachToVisualTree void
CoerceIsDropDownOpen object
CoerceMaxDate object
CoerceValue object
DatePicker System
DetachFromVisualTree void
DoFormat string
DoFormat string
DoParse bool
GetFlag bool
IsFocusable bool
KeyDownHandler void
KeyDownHandler void
KeyboardToggleDropDown void
OnCanEditChanged void
OnContextMenuClose void
OnContextMenuOpen void
OnDateConverterChanged void
OnDateSelectionChanged void
OnDropDownButtonStyleChanged void
OnEditableTextBoxKeyDown void
OnEditableTextBoxLostFocus void
OnEditableTextBoxTextChanged void
OnIsDropDownOpenChanged void
OnMaxDateChanged void
OnMinDateChanged void
OnMonthCalendarCommandPreviewExecuted void
OnMonthCalendarVisibleMonthChanged void
OnMouseButtonDown void
OnNullValueTextChanged void
OnValueChanged void
OpenOnLoad void
RefreshDropDownButtonStyle void
SelectFocusableDate void
SetFlag void
UpdateEditableTextBox void

Открытые методы

Метод Описание
OnApplyTemplate ( ) : void

Called when the Template's tree has been generated

ToString ( ) : string

Returns a string representation for this control. "...DatePicker, Value:06/02/2006"

Защищенные методы

Метод Описание
OnDropDownClosed ( RoutedEventArgs e ) : void

Raise DropDownClosed event

OnDropDownOpened ( RoutedEventArgs e ) : void

Raise DropDownOpened event

OnGotKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void

Called when this element gets focus.

OnInvalidEntry ( InvalidEntryEventArgs e ) : void

This event is invoked when datepicker can't parse the input string correctly

OnLostMouseCapture ( System.Windows.Input.MouseEventArgs e ) : void

Close the dropdown content if DatePicker lost the mouse capture

OnPreviewMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void

When datepicker is editable, clicks the entry box should close the datepicker..

OnValueChanged ( RoutedPropertyChangedEventArgs e ) : void

This method is invoked when the Value property changes.

Приватные методы

Метод Описание
AttachToVisualTree ( ) : void

Detaches the EditableTextBox, MonthCalendar from old child tree and attaches them to a new one

CoerceIsDropDownOpen ( DependencyObject d, object value ) : object

Coerce IsDropDownOpen with IsLoaded, so set IsDropDownOpen to true before UI ready can work

CoerceMaxDate ( DependencyObject d, object value ) : object
CoerceValue ( DependencyObject d, object value ) : object
DatePicker ( ) : System

Static Constructor

DetachFromVisualTree ( ) : void

Clear the event, and detach our current EditableTextBox from ComboBox

DoFormat ( ) : string

Format Value property to a formatted string

DoFormat ( System.DateTime date ) : string
DoParse ( string text ) : bool

Parse the input string, if the input string is a valid date, return the Date, else return null

If the input entry equals NullValueText, Value will be set to null If the input entry is a valid date, Value will be set to the input date If the input entry isn't a valid date, InvalidEntry event will be fired, Value will still keep the old value (don't set to null)

GetFlag ( Flags flag ) : bool
IsFocusable ( FrameworkElement fe ) : bool

True if the element can be focused

KeyDownHandler ( System.Windows.Input.KeyEventArgs e ) : void
KeyDownHandler ( object sender, System.Windows.Input.KeyEventArgs e ) : void

Called when a key event occurs.

KeyboardToggleDropDown ( bool openDropDown, bool commitSelection ) : void

Close the dropdown and commit the selection if requested. Make sure to set the selection after the dropdown has closed Don't trigger any unnecessary navigation as a result of changing the selection.

OnCanEditChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnContextMenuClose ( object sender, System.Windows.Controls.ContextMenuEventArgs e ) : void
OnContextMenuOpen ( object sender, System.Windows.Controls.ContextMenuEventArgs e ) : void
OnDateConverterChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnDateSelectionChanged ( object sender, DateSelectionChangedEventArgs e ) : void
OnDropDownButtonStyleChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnEditableTextBoxKeyDown ( object sender, System.Windows.Input.KeyEventArgs e ) : void

If Key.Enter is pressed, DatePicker will parse the Text no matter it changed or not

OnEditableTextBoxLostFocus ( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void

If EditableTextBoxSite loses focus and Text has been changed, DatePicker will parse Text

OnEditableTextBoxTextChanged ( object sender, System.Windows.Controls.TextChangedEventArgs e ) : void

If Text has been changed, the flag Flags.IsTextChanged will be set to true, so DatePicker can decide to parse the Text or not

OnIsDropDownOpenChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnMaxDateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnMinDateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnMonthCalendarCommandPreviewExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs args ) : void
OnMonthCalendarVisibleMonthChanged ( object sender, RoutedPropertyChangedEventArgs e ) : void
OnMouseButtonDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

If we (or one of our children) are clicked, claim the focus

OnNullValueTextChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnValueChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OpenOnLoad ( object sender, RoutedEventArgs e ) : void
RefreshDropDownButtonStyle ( ) : void
SelectFocusableDate ( ) : void

Select the focusable date

SetFlag ( Flags flag, bool set ) : void
UpdateEditableTextBox ( string text ) : void

Update the Text to the TextBox in editable mode

Описание методов

OnApplyTemplate() публичный Метод

Called when the Template's tree has been generated
public OnApplyTemplate ( ) : void
Результат void

OnDropDownClosed() защищенный Метод

Raise DropDownClosed event
protected OnDropDownClosed ( RoutedEventArgs e ) : void
e System.Windows.RoutedEventArgs
Результат void

OnDropDownOpened() защищенный Метод

Raise DropDownOpened event
protected OnDropDownOpened ( RoutedEventArgs e ) : void
e System.Windows.RoutedEventArgs
Результат void

OnGotKeyboardFocus() защищенный Метод

Called when this element gets focus.
protected OnGotKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void
e System.Windows.Input.KeyboardFocusChangedEventArgs
Результат void

OnInvalidEntry() защищенный Метод

This event is invoked when datepicker can't parse the input string correctly
protected OnInvalidEntry ( InvalidEntryEventArgs e ) : void
e InvalidEntryEventArgs
Результат void

OnLostMouseCapture() защищенный Метод

Close the dropdown content if DatePicker lost the mouse capture
protected OnLostMouseCapture ( System.Windows.Input.MouseEventArgs e ) : void
e System.Windows.Input.MouseEventArgs
Результат void

OnPreviewMouseLeftButtonDown() защищенный Метод

When datepicker is editable, clicks the entry box should close the datepicker..
protected OnPreviewMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs
Результат void

OnValueChanged() защищенный Метод

This method is invoked when the Value property changes.
protected OnValueChanged ( RoutedPropertyChangedEventArgs e ) : void
e RoutedPropertyChangedEventArgs RoutedPropertyChangedEventArgs contains the old and new value.
Результат void

ToString() публичный Метод

Returns a string representation for this control. "...DatePicker, Value:06/02/2006"
public ToString ( ) : string
Результат string

Описание свойств

CanEditProperty публичное статическое свойство

The DependencyProperty for the CanEdit property
public static DependencyProperty,System.Windows CanEditProperty
Результат System.Windows.DependencyProperty

DateConverterProperty публичное статическое свойство

The DependencyProperty for the DateConverter Property
public static DependencyProperty,System.Windows DateConverterProperty
Результат System.Windows.DependencyProperty

DropDownButtonStyleProperty публичное статическое свойство

The DependencyProperty for the DropDownButtonStyle property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DropDownButtonStyleProperty
Результат System.Windows.DependencyProperty

DropDownClosedEvent публичное статическое свойство

DropDownClosed event
public static RoutedEvent,System.Windows DropDownClosedEvent
Результат System.Windows.RoutedEvent

DropDownOpenedEvent публичное статическое свойство

DropDownOpened event
public static RoutedEvent,System.Windows DropDownOpenedEvent
Результат System.Windows.RoutedEvent

InvalidEntryEvent публичное статическое свойство

InvalidEntry event
public static RoutedEvent,System.Windows InvalidEntryEvent
Результат System.Windows.RoutedEvent

IsDropDownOpenProperty публичное статическое свойство

The DependencyProperty for the IsDropDownOpen property
public static DependencyProperty,System.Windows IsDropDownOpenProperty
Результат System.Windows.DependencyProperty

IsReadOnlyProperty публичное статическое свойство

The DependencyProperty for the IsReadOnly Property
public static DependencyProperty,System.Windows IsReadOnlyProperty
Результат System.Windows.DependencyProperty

IsValidProperty публичное статическое свойство

The DependencyProperty for the IsValid property.
public static DependencyProperty,System.Windows IsValidProperty
Результат System.Windows.DependencyProperty

MaxDateProperty публичное статическое свойство

The Property for the MaxDate property.
public static DependencyProperty,System.Windows MaxDateProperty
Результат System.Windows.DependencyProperty

MinDateProperty публичное статическое свойство

The Property for the MinDate property.
public static DependencyProperty,System.Windows MinDateProperty
Результат System.Windows.DependencyProperty

MonthCalendarStyleProperty публичное статическое свойство

The DependencyProperty for the MonthCalendarStyle Property
public static DependencyProperty,System.Windows MonthCalendarStyleProperty
Результат System.Windows.DependencyProperty

NullValueTextProperty публичное статическое свойство

The DependencyProperty for the NullValueText Property
public static DependencyProperty,System.Windows NullValueTextProperty
Результат System.Windows.DependencyProperty

TextProperty публичное статическое свойство

The DependencyProperty for the Text property.
public static DependencyProperty,System.Windows TextProperty
Результат System.Windows.DependencyProperty

ValueChangedEvent публичное статическое свойство

Event ID correspond to Value changed event
public static RoutedEvent,System.Windows ValueChangedEvent
Результат System.Windows.RoutedEvent

ValueProperty публичное статическое свойство

The DependencyProperty for the Value property
public static DependencyProperty,System.Windows ValueProperty
Результат System.Windows.DependencyProperty