C# 클래스 Microsoft.Samples.KMoore.WPFSamples.DateControls.MonthCalendar

상속: System.Windows.Controls.Control, IWeakEventListener
파일 보기 프로젝트 열기: daszat/zetbox 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
DataSourceDatePathProperty System.Windows.DependencyProperty
DataSourceDateXPathProperty System.Windows.DependencyProperty
DataSourceProperty System.Windows.DependencyProperty
DateSelectionChangedEvent System.Windows.RoutedEvent
DayContainerStyleProperty System.Windows.DependencyProperty
DayContainerStyleSelectorProperty System.Windows.DependencyProperty
DayHeaderStyleProperty System.Windows.DependencyProperty
DayTemplateProperty System.Windows.DependencyProperty
DayTemplateSelectorProperty System.Windows.DependencyProperty
FirstDayOfWeekProperty System.Windows.DependencyProperty
MaxDateProperty System.Windows.DependencyProperty
MaxSelectionCountProperty System.Windows.DependencyProperty
MinDateProperty System.Windows.DependencyProperty
NextButtonStyleProperty System.Windows.DependencyProperty
PreviousButtonStyleProperty System.Windows.DependencyProperty
SelectedDateProperty System.Windows.DependencyProperty
ShowsDayHeadersProperty System.Windows.DependencyProperty
ShowsTitleProperty System.Windows.DependencyProperty
ShowsWeekNumbersProperty System.Windows.DependencyProperty
TitleStyleProperty System.Windows.DependencyProperty
VisibleMonthChangedEvent System.Windows.RoutedEvent
VisibleMonthProperty System.Windows.DependencyProperty
WeekNumberStyleProperty System.Windows.DependencyProperty

Private Properties

프로퍼티 타입 설명
AddToDictionary void
AttachToVisualTree void
CoerceMaxDate object
CoerceVisibleMonth object
CreateVisibleDaysCollection ObservableCollection
DetachFromVisualTree void
FindFocusableDate DateTime?
GetCalendarDateByDate CalendarDate
GetFlag bool
GetKeyFromDataSourceItem DateTime?
IWeakEventListener bool
InvalidateVisibleDays void
InvokeDateSelectedChangedEvent void
IsFocusable bool
IsLeadingTrailingDay bool
IsValidDate bool
IsValidFirstDayOfWeek bool
IsValidMaxSelectionCount bool
IsValidNullableDate bool
MonthCalendar System
OnContainerLayoutUpdated void
OnContainerSelectionChanged void
OnDataSourceChanged void
OnDataSourceCollectionChanged void
OnDataSourceDatePathChanged void
OnDayContainerStyleChanged void
OnDayTemplateChanged void
OnDayTemplateSelectorChanged void
OnExecuteGotoCommand void
OnExecuteNextCommand void
OnExecutePreviousCommand void
OnFirstDayOfWeekChanged void
OnMaxDateChanged void
OnMaxMinDateChanged void
OnMaxSelectionCountChanged void
OnMinDateChanged void
OnNextButtonStyleChanged void
OnPreviousButtonStyleChanged void
OnQueryGotoCommand void
OnQueryNextCommand void
OnQueryPreviousCommand void
OnSelectedDateChanged void
OnSelectedDatesCollectionChanged void
OnVisibleMonthChanged void
RefreshDayTemplate void
RefreshNextButtonStyle void
RefreshPreviousButtonStyle void
RemoveFromDictionary void
RestoreSelection void
ScrollVisibleMonth void
SetFlag void
SetSelectionByRange void
TrimSelectedDates void
UpdateDataSource void
UpdateDataSourceToCalendarDates void

공개 메소드들

메소드 설명
GetContainerFromDate ( System.DateTime date ) : MonthCalendarItem

Return the UI element corresponding to the given date. Returns null if the date does not belong to the visible days or if no UI has been generated for it.

OnApplyTemplate ( ) : void

Called when the Template's tree has been generated

ToString ( ) : string

Returns a string representation for this control.

보호된 메소드들

메소드 설명
OnDateSelectionChanged ( DateSelectionChangedEventArgs e ) : void

Raise DateSelectionChanged event.

OnPreviewKeyDown ( System.Windows.Input.KeyEventArgs e ) : void

This is the method that responds to the PreviewKeyDown event.

Override OnPreviewKeyDown isn't recommended for Control Author, it's reserved for customer Because MonthCalenarContainer already handles the PageUp/PageDown/Home/End, we have to use Preview here.

OnVisibleMonthChanged ( RoutedPropertyChangedEventArgs e ) : void

Raise VisibleMonthChanged event.

비공개 메소드들

메소드 설명
AddToDictionary ( object value ) : void

Add value to data source dictionary

AttachToVisualTree ( ) : void

Walk to visual tree to find the MonthCalendarContainer. Set the GroupFactory and GroupPanel. Register the selection change event if it is a Selector.

CoerceMaxDate ( DependencyObject d, object value ) : object
CoerceVisibleMonth ( DependencyObject d, object value ) : object
CreateVisibleDaysCollection ( System.DateTime firstDate, System.DateTime lastDate, DayOfWeek firstDayOfWeek ) : ObservableCollection

Generate the visible days collection based on the input firstdate, lastdate and firstdayofweek

DetachFromVisualTree ( ) : void

Clear our layout-specific data, and detach our current itemscontrol from monthcalendar

FindFocusableDate ( System.DateTime start, System.DateTime end, bool direction ) : DateTime?

GetCalendarDateByDate ( System.DateTime date ) : CalendarDate

Get the CalendarDate by date

GetFlag ( Flags flag ) : bool
GetKeyFromDataSourceItem ( object value ) : DateTime?

Get the DateTime value from the value with DataSourceDatePath/XPath the value works as a key for data source dictionary

IWeakEventListener ( Type managerType, object sender, EventArgs e ) : bool

Handle events from the centralized event table

InvalidateVisibleDays ( int scrollChange ) : void

Invalidate the visible days when switch month

InvokeDateSelectedChangedEvent ( List unselected, List selected ) : void

Raise the SelectionChanged event.

IsFocusable ( FrameworkElement fe ) : bool

True if the element can be focused

IsLeadingTrailingDay ( System.DateTime date ) : bool

True if the date is leading or traing day

IsValidDate ( object value ) : bool

Validate input value in MonthCalendar (MinDate, MaxDate, VisibleMonth)

IsValidFirstDayOfWeek ( object value ) : bool
IsValidMaxSelectionCount ( object o ) : bool
IsValidNullableDate ( object value ) : bool

Validate input value in MonthCalendar

MonthCalendar ( ) : System

Static Constructor

OnContainerLayoutUpdated ( object sender, EventArgs e ) : void

Update the SelectedDates to UI if those dates are added before UI ready

OnContainerSelectionChanged ( object sender, System.Windows.Controls.SelectionChangedEventArgs e ) : void

Update the selected dates status when user changes it by UI

OnDataSourceChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnDataSourceCollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void

Update the CalendarDate.Data property when DataSource collection is changed

OnDataSourceDatePathChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnDayContainerStyleChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Called when DayContainerStyleProperty is invalidated on "d."

OnDayTemplateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Called when DayTemplateProperty is invalidated on "d."

OnDayTemplateSelectorChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Called when DayTemplateSelectorProperty is invalidated on "d."

OnExecuteGotoCommand ( object target, System.Windows.Input.ExecutedRoutedEventArgs args ) : void
OnExecuteNextCommand ( object target, System.Windows.Input.ExecutedRoutedEventArgs args ) : void
OnExecutePreviousCommand ( object target, System.Windows.Input.ExecutedRoutedEventArgs args ) : void
OnFirstDayOfWeekChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnMaxDateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnMaxMinDateChanged ( System.DateTime minDate, System.DateTime maxDate ) : void

Update the IsSelectable property of visible days and selected dates when max/min date has been changed

OnMaxSelectionCountChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnMinDateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnNextButtonStyleChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnPreviousButtonStyleChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnQueryGotoCommand ( object target, System.Windows.Input.CanExecuteRoutedEventArgs args ) : void
OnQueryNextCommand ( object target, System.Windows.Input.CanExecuteRoutedEventArgs args ) : void
OnQueryPreviousCommand ( object target, System.Windows.Input.CanExecuteRoutedEventArgs args ) : void
OnSelectedDateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnSelectedDatesCollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void

Handle SelectedDates collection changed event

OnVisibleMonthChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
RefreshDayTemplate ( ) : void

Refresh the ItemTemplate/ItemTemplateSelector/ItemContainerStyle if DayTemplate/DayTemplateSelecotr/DayContainerStyle is set

RefreshNextButtonStyle ( ) : void
RefreshPreviousButtonStyle ( ) : void
RemoveFromDictionary ( object value ) : void

Remove value from data source dictionary

RestoreSelection ( int scrollChange ) : void

Restore the selection UI after switching month

ScrollVisibleMonth ( int direction, int delta ) : void

Scroll the current visible month of MothCalendar based on delta and direction

SetFlag ( Flags flag, bool set ) : void
SetSelectionByRange ( System.DateTime start, System.DateTime end ) : void

Select the dates between start and end. If one of them is null, only select the other one

TrimSelectedDates ( int limit ) : void

Delete redundant selected dates to fit the new MaxSelectionCount value

UpdateDataSource ( ) : void
UpdateDataSourceToCalendarDates ( ) : void

Update the data source data to the specific calendar dates

메소드 상세

GetContainerFromDate() 공개 메소드

Return the UI element corresponding to the given date. Returns null if the date does not belong to the visible days or if no UI has been generated for it.
public GetContainerFromDate ( System.DateTime date ) : MonthCalendarItem
date System.DateTime
리턴 MonthCalendarItem

OnApplyTemplate() 공개 메소드

Called when the Template's tree has been generated
public OnApplyTemplate ( ) : void
리턴 void

OnDateSelectionChanged() 보호된 메소드

Raise DateSelectionChanged event.
protected OnDateSelectionChanged ( DateSelectionChangedEventArgs e ) : void
e DateSelectionChangedEventArgs
리턴 void

OnPreviewKeyDown() 보호된 메소드

This is the method that responds to the PreviewKeyDown event.
Override OnPreviewKeyDown isn't recommended for Control Author, it's reserved for customer Because MonthCalenarContainer already handles the PageUp/PageDown/Home/End, we have to use Preview here.
protected OnPreviewKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs Event Arguments
리턴 void

OnVisibleMonthChanged() 보호된 메소드

Raise VisibleMonthChanged event.
protected OnVisibleMonthChanged ( RoutedPropertyChangedEventArgs e ) : void
e RoutedPropertyChangedEventArgs RoutedPropertyChangedEventArgs contains the old and new value.
리턴 void

ToString() 공개 메소드

Returns a string representation for this control.
public ToString ( ) : string
리턴 string

프로퍼티 상세

DataSourceDatePathProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the DataSourceDatePath property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DataSourceDatePathProperty
리턴 System.Windows.DependencyProperty

DataSourceDateXPathProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the DataSourceDateXPath property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DataSourceDateXPathProperty
리턴 System.Windows.DependencyProperty

DataSourceProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for DataSource property
public static DependencyProperty,System.Windows DataSourceProperty
리턴 System.Windows.DependencyProperty

DateSelectionChangedEvent 공개적으로 정적으로 프로퍼티

An event fired when the selection changes
public static RoutedEvent,System.Windows DateSelectionChangedEvent
리턴 System.Windows.RoutedEvent

DayContainerStyleProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the DayContainerStyle property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DayContainerStyleProperty
리턴 System.Windows.DependencyProperty

DayContainerStyleSelectorProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the DayContainerStyleSelector property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DayContainerStyleSelectorProperty
리턴 System.Windows.DependencyProperty

DayHeaderStyleProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the DayHeaderStyle property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DayHeaderStyleProperty
리턴 System.Windows.DependencyProperty

DayTemplateProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the DayTemplate property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DayTemplateProperty
리턴 System.Windows.DependencyProperty

DayTemplateSelectorProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the DayTemplateSelector property. Flags: none Default Value: null
public static DependencyProperty,System.Windows DayTemplateSelectorProperty
리턴 System.Windows.DependencyProperty

FirstDayOfWeekProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for FirstDayOfWeek property
public static DependencyProperty,System.Windows FirstDayOfWeekProperty
리턴 System.Windows.DependencyProperty

MaxDateProperty 공개적으로 정적으로 프로퍼티

The Property for the MaxDate property.
public static DependencyProperty,System.Windows MaxDateProperty
리턴 System.Windows.DependencyProperty

MaxSelectionCountProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for MaxSelectionCount property
public static DependencyProperty,System.Windows MaxSelectionCountProperty
리턴 System.Windows.DependencyProperty

MinDateProperty 공개적으로 정적으로 프로퍼티

The Property for the MinDate property.
public static DependencyProperty,System.Windows MinDateProperty
리턴 System.Windows.DependencyProperty

NextButtonStyleProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the NextButtonStyle property. Flags: none Default Value: null
public static DependencyProperty,System.Windows NextButtonStyleProperty
리턴 System.Windows.DependencyProperty

PreviousButtonStyleProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the PreviousButtonStyle property. Flags: none Default Value: null
public static DependencyProperty,System.Windows PreviousButtonStyleProperty
리턴 System.Windows.DependencyProperty

SelectedDateProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for SelectedDate property
public static DependencyProperty,System.Windows SelectedDateProperty
리턴 System.Windows.DependencyProperty

ShowsDayHeadersProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for ShowsDayHeaders property
public static DependencyProperty,System.Windows ShowsDayHeadersProperty
리턴 System.Windows.DependencyProperty

ShowsTitleProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for ShowsTitle property
public static DependencyProperty,System.Windows ShowsTitleProperty
리턴 System.Windows.DependencyProperty

ShowsWeekNumbersProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for ShowsWeekNumbers property
public static DependencyProperty,System.Windows ShowsWeekNumbersProperty
리턴 System.Windows.DependencyProperty

TitleStyleProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the TitleStyle property. Flags: none Default Value: null
public static DependencyProperty,System.Windows TitleStyleProperty
리턴 System.Windows.DependencyProperty

VisibleMonthChangedEvent 공개적으로 정적으로 프로퍼티

An event fired when the display month switches
public static RoutedEvent,System.Windows VisibleMonthChangedEvent
리턴 System.Windows.RoutedEvent

VisibleMonthProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for VisibleMonth property
public static DependencyProperty,System.Windows VisibleMonthProperty
리턴 System.Windows.DependencyProperty

WeekNumberStyleProperty 공개적으로 정적으로 프로퍼티

The DependencyProperty for the WeekNumberStyle property. Flags: none Default Value: null
public static DependencyProperty,System.Windows WeekNumberStyleProperty
리턴 System.Windows.DependencyProperty