C# Class Microsoft.Samples.KMoore.WPFSamples.DateControls.DatePicker

Inheritance: System.Windows.Controls.Control
Afficher le fichier Open project: daszat/zetbox

Méthodes publiques

Свойство Type Description
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

Свойство Type Description
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

Méthodes publiques

Méthode Description
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"

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

OnApplyTemplate() public méthode

Called when the Template's tree has been generated
public OnApplyTemplate ( ) : void
Résultat void

OnDropDownClosed() protected méthode

Raise DropDownClosed event
protected OnDropDownClosed ( RoutedEventArgs e ) : void
e System.Windows.RoutedEventArgs
Résultat void

OnDropDownOpened() protected méthode

Raise DropDownOpened event
protected OnDropDownOpened ( RoutedEventArgs e ) : void
e System.Windows.RoutedEventArgs
Résultat void

OnGotKeyboardFocus() protected méthode

Called when this element gets focus.
protected OnGotKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void
e System.Windows.Input.KeyboardFocusChangedEventArgs
Résultat void

OnInvalidEntry() protected méthode

This event is invoked when datepicker can't parse the input string correctly
protected OnInvalidEntry ( InvalidEntryEventArgs e ) : void
e InvalidEntryEventArgs
Résultat void

OnLostMouseCapture() protected méthode

Close the dropdown content if DatePicker lost the mouse capture
protected OnLostMouseCapture ( System.Windows.Input.MouseEventArgs e ) : void
e System.Windows.Input.MouseEventArgs
Résultat void

OnPreviewMouseLeftButtonDown() protected méthode

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
Résultat void

OnValueChanged() protected méthode

This method is invoked when the Value property changes.
protected OnValueChanged ( RoutedPropertyChangedEventArgs e ) : void
e RoutedPropertyChangedEventArgs RoutedPropertyChangedEventArgs contains the old and new value.
Résultat void

ToString() public méthode

Returns a string representation for this control. "...DatePicker, Value:06/02/2006"
public ToString ( ) : string
Résultat string

Property Details

CanEditProperty public_oe static_oe property

The DependencyProperty for the CanEdit property
public static DependencyProperty,System.Windows CanEditProperty
Résultat System.Windows.DependencyProperty

DateConverterProperty public_oe static_oe property

The DependencyProperty for the DateConverter Property
public static DependencyProperty,System.Windows DateConverterProperty
Résultat System.Windows.DependencyProperty

DropDownButtonStyleProperty public_oe static_oe property

The DependencyProperty for the DropDownButtonStyle property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DropDownButtonStyleProperty
Résultat System.Windows.DependencyProperty

DropDownClosedEvent public_oe static_oe property

DropDownClosed event
public static RoutedEvent,System.Windows DropDownClosedEvent
Résultat System.Windows.RoutedEvent

DropDownOpenedEvent public_oe static_oe property

DropDownOpened event
public static RoutedEvent,System.Windows DropDownOpenedEvent
Résultat System.Windows.RoutedEvent

InvalidEntryEvent public_oe static_oe property

InvalidEntry event
public static RoutedEvent,System.Windows InvalidEntryEvent
Résultat System.Windows.RoutedEvent

IsDropDownOpenProperty public_oe static_oe property

The DependencyProperty for the IsDropDownOpen property
public static DependencyProperty,System.Windows IsDropDownOpenProperty
Résultat System.Windows.DependencyProperty

IsReadOnlyProperty public_oe static_oe property

The DependencyProperty for the IsReadOnly Property
public static DependencyProperty,System.Windows IsReadOnlyProperty
Résultat System.Windows.DependencyProperty

IsValidProperty public_oe static_oe property

The DependencyProperty for the IsValid property.
public static DependencyProperty,System.Windows IsValidProperty
Résultat System.Windows.DependencyProperty

MaxDateProperty public_oe static_oe property

The Property for the MaxDate property.
public static DependencyProperty,System.Windows MaxDateProperty
Résultat System.Windows.DependencyProperty

MinDateProperty public_oe static_oe property

The Property for the MinDate property.
public static DependencyProperty,System.Windows MinDateProperty
Résultat System.Windows.DependencyProperty

MonthCalendarStyleProperty public_oe static_oe property

The DependencyProperty for the MonthCalendarStyle Property
public static DependencyProperty,System.Windows MonthCalendarStyleProperty
Résultat System.Windows.DependencyProperty

NullValueTextProperty public_oe static_oe property

The DependencyProperty for the NullValueText Property
public static DependencyProperty,System.Windows NullValueTextProperty
Résultat System.Windows.DependencyProperty

TextProperty public_oe static_oe property

The DependencyProperty for the Text property.
public static DependencyProperty,System.Windows TextProperty
Résultat System.Windows.DependencyProperty

ValueChangedEvent public_oe static_oe property

Event ID correspond to Value changed event
public static RoutedEvent,System.Windows ValueChangedEvent
Résultat System.Windows.RoutedEvent

ValueProperty public_oe static_oe property

The DependencyProperty for the Value property
public static DependencyProperty,System.Windows ValueProperty
Résultat System.Windows.DependencyProperty