[]
Represents a CalendarDayButton control for GrapeCity.Windows.InputMan.Primitives.DayInfo presentation. It represents a day when GrapeCity.Windows.InputMan.GcDropDownCalendar.DisplayMode property is GrapeCity.Windows.InputMan.CalendarMode.Month.
[TemplatePart(Name = "PART_Content", Type = typeof(FrameworkElement))]
[TemplateVisualState(Name = "Selected", GroupName = "SelectionStates")]
[TemplateVisualState(Name = "Unselected", GroupName = "SelectionStates")]
[TemplateVisualState(Name = "RegularDay", GroupName = "DayStates")]
[TemplateVisualState(Name = "Today", GroupName = "DayStates")]
[TemplateVisualState(Name = "BlackoutDay", GroupName = "BlackoutDayStates")]
[TemplateVisualState(Name = "NormalDay", GroupName = "BlackoutDayStates")]
[TemplateVisualState(Name = "CalendarButtonFocused", GroupName = "CalendarButtonFocusStates")]
[TemplateVisualState(Name = "CalendarButtonUnfocused", GroupName = "CalendarButtonFocusStates")]
[TemplateVisualState(Name = "ForcedWorkday", GroupName = "HolidayStates")]
[TemplateVisualState(Name = "OverrideHoliday", GroupName = "HolidayStates")]
[TemplateVisualState(Name = "WeeklyHoliday", GroupName = "HolidayStates")]
[TemplateVisualState(Name = "Holiday", GroupName = "HolidayStates")]
[TemplateVisualState(Name = "Workday", GroupName = "HolidayStates")]
[TemplateVisualState(Name = "Active", GroupName = "ActiveStates")]
[TemplateVisualState(Name = "Inactive", GroupName = "ActiveStates")]
public sealed class CalendarDayButton : Button, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, ICommandSource
<TemplatePart(Name:="PART_Content", Type:=GetType(FrameworkElement))>
<TemplateVisualState(Name:="Selected", GroupName:="SelectionStates")>
<TemplateVisualState(Name:="Unselected", GroupName:="SelectionStates")>
<TemplateVisualState(Name:="RegularDay", GroupName:="DayStates")>
<TemplateVisualState(Name:="Today", GroupName:="DayStates")>
<TemplateVisualState(Name:="BlackoutDay", GroupName:="BlackoutDayStates")>
<TemplateVisualState(Name:="NormalDay", GroupName:="BlackoutDayStates")>
<TemplateVisualState(Name:="CalendarButtonFocused", GroupName:="CalendarButtonFocusStates")>
<TemplateVisualState(Name:="CalendarButtonUnfocused", GroupName:="CalendarButtonFocusStates")>
<TemplateVisualState(Name:="ForcedWorkday", GroupName:="HolidayStates")>
<TemplateVisualState(Name:="OverrideHoliday", GroupName:="HolidayStates")>
<TemplateVisualState(Name:="WeeklyHoliday", GroupName:="HolidayStates")>
<TemplateVisualState(Name:="Holiday", GroupName:="HolidayStates")>
<TemplateVisualState(Name:="Workday", GroupName:="HolidayStates")>
<TemplateVisualState(Name:="Active", GroupName:="ActiveStates")>
<TemplateVisualState(Name:="Inactive", GroupName:="ActiveStates")>
Public NotInheritable Class CalendarDayButton
Inherits Button
Implements IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, ICommandSource
The CalendarDayButton offered some properties for customizing visual presentation via styling:
The IsInactive indicates whether the CalendarDayButton is trailing status. The IsSelected indicates whether the day the CalendarDayButton represents is selected. The IsToday indicates whether the day the CalendarDayButton represents Today. The IsBlackedOut indicates whether the day the CalendarDayButton represents is non-selectable.
The CalendarDayButton also offered a DayInfo property to deliver more information about the day which it represents. It is set to the Content property, and you could also customizing the data presentation via ContentTemplate.
Supported VisualState list:
VisualStateGroup Name | VisualState Name | Description |
---|---|---|
CommonStates | Normal | Represents the visual appearance when control is in normal state. |
CommonStates | Disabled | |
CommonStates | Pressed | |
CommonStates | MouseOver | Represents the visual appearance when IsMouseOver is true. |
SelectionStates | Selected | Represents the visual appearance when IsHighlighted or IsSelected is true.
|
SelectionStates | Unselected | Represents the visual appearance when IsHighlighted and IsSelected all are false. |
ActiveStates | Active | Represents the visual appearance when IsInactive is false.
|
ActiveStates | Inactive | Represents the visual appearance when IsInactive is true. |
CalendarButtonFocusStates | CalendarButtonFocused | Represents the visual appearance when IsKeyboardFocused is true.
|
CalendarButtonFocusStates | CalendarButtonUnfocused | Represents the visual appearance when IsKeyboardFocused is false. |
DayStates | Today | Represents the visual appearance when IsToday is true.
|
DayStates | RegularDay | |
BlackoutDayStates | BlackoutDay | Represents the visual appearance when IsBlackedOut is true.
|
BlackoutDayStates | NormalDay | Represents the visual appearance when IsBlackedOut is false. |
HolidayStates | OverrideHoliday | Represents the visual appearance when GrapeCity.Windows.InputMan.Primitives.DayInfo.IsOverrideHoliday is true.
|
HolidayStates | WeeklyHoliday | Represents the visual appearance when GrapeCity.Windows.InputMan.Primitives.DayInfo.IsWeeklyHoliday is true.
|
HolidayStates | Holiday | Represents the visual appearance when GrapeCity.Windows.InputMan.Primitives.DayInfo.IsHoliday is true but GrapeCity.Windows.InputMan.Primitives.DayInfo.IsWeeklyHoliday and GrapeCity.Windows.InputMan.Primitives.DayInfo.IsOverrideHoliday are false. |
HolidayStates | ForcedWorkday | Represents the visual appearance when GrapeCity.Windows.InputMan.Primitives.DayInfo.IsForceWorkday is true.
|
HolidayStates | Workday | Represents the visual appearance when GrapeCity.Windows.InputMan.Primitives.DayInfo.IsForceWorkday, GrapeCity.Windows.InputMan.Primitives.DayInfo.IsWeeklyHoliday, GrapeCity.Windows.InputMan.Primitives.DayInfo.IsOverrideHoliday and GrapeCity.Windows.InputMan.Primitives.DayInfo.IsHoliday all are false. |
FocusStates | Focused | Represents the visual appearance when IsKeyboardFocused is true. |
FocusStates | Unfocused | Represents the visual appearance when IsKeyboardFocused is false. |
ValidationStates | Valid | Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns false. |
ValidationStates | InvalidFocused | Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns true and IsKeyboardFocused is true. |
ValidationStates | InvalidUnfocused | Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns true and IsKeyboardFocused is false. |
Name | Description |
---|---|
CalendarDayButton() | Initializes a new instance of the CalendarDayButton class. |
Name | Description |
---|---|
DayInfoProperty | Identifies the DayInfo DependencyProperty. |
IsBlackedOutProperty | Identifies the IsBlackedOut DependencyProperty. |
IsHighlightedProperty | Identifies the IsHighlighted DependencyProperty. |
IsInactiveProperty | Identifies the IsInactive DependencyProperty. |
IsSelectedProperty | Identifies the IsSelected DependencyProperty. |
IsTodayProperty | Identifies the IsToday DependencyProperty. |
Name | Description |
---|---|
DayInfo | Gets the GrapeCity.Windows.InputMan.Primitives.DayInfo of which contains the advanced information of the day that the CalendarDayButton represents. |
IsBlackedOut | Gets a value indicating whether the date of DayInfo is defined non-selectable. |
IsHighlighted | Gets a value indicating whether this button is highlighted. This is a dependency property. |
IsInactive | Gets a value indicating whether the date of DayInfo is a trailing day. |
IsSelected | Gets a value indicating whether the date of DayInfo is in the selection of GrapeCity.Windows.InputMan.GcDropDownCalendar. |
IsToday | Gets a value indicating whether the date of DayInfo is Today. |
Name | Description |
---|---|
OnApplyTemplate() | When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate(). |
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs) | Invoked when an unhandled System.Windows.Input.Keyboard.GotKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. |
OnLostKeyboardFocus(KeyboardFocusChangedEventArgs) | Called when an element loses keyboard focus. |