[]
        
(Showing Draft Content)

GrapeCity.Wpf.SpreadSheet.CellType.Editors.CalendarDayButton

CalendarDayButton Class

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.

Namespace: GrapeCity.Wpf.SpreadSheet.CellType.Editors
Assembly: GrapeCity.Wpf.SpreadSheet.CellType.dll
Syntax
[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
Remarks

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

Represents the visual appearance when IsEnabled is false.

CommonStates

Pressed

Represents the visual appearance when IsPressed is true.

CommonStates

MouseOver

Represents the visual appearance when IsMouseOver is true.

SelectionStates

Selected

Represents the visual appearance when IsHighlighted or IsSelected is true.
If the Selected state isn't defined in ControlTemplate, Unselected state will be used.

SelectionStates

Unselected

Represents the visual appearance when IsHighlighted and IsSelected all are false.

ActiveStates

Active

Represents the visual appearance when IsInactive is false.
If the Active state isn't defined in ControlTemplate, Inactive state will be used.

ActiveStates

Inactive

Represents the visual appearance when IsInactive is true.

CalendarButtonFocusStates

CalendarButtonFocused

Represents the visual appearance when IsKeyboardFocused is true.
If the CalendarButtonFocused state isn't defined in ControlTemplate, CalendarButtonUnfocused state will be used.

CalendarButtonFocusStates

CalendarButtonUnfocused

Represents the visual appearance when IsKeyboardFocused is false.

DayStates

Today

Represents the visual appearance when IsToday is true.
If the Today state isn't defined in ControlTemplate, RegularDay state will be used.

DayStates

RegularDay

Represents the visual appearance when IsToday is false.

BlackoutDayStates

BlackoutDay

Represents the visual appearance when IsBlackedOut is true.
If the BlackoutDay state isn't defined in ControlTemplate, NormalDay state will be used.

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.
If the OverrideHoliday state isn't defined in ControlTemplate, Holiday state will be used.

HolidayStates

WeeklyHoliday

Represents the visual appearance when GrapeCity.Windows.InputMan.Primitives.DayInfo.IsWeeklyHoliday is true.
If the WeeklyHoliday state isn't defined in ControlTemplate, Holiday state will be used.

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.
If the ForcedWorkday state isn't defined in ControlTemplate, Workday state will be used.

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.

Constructors

Name Description
CalendarDayButton()

Initializes a new instance of the CalendarDayButton class.

Fields

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.

Properties

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.

Methods

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.