[]
        
(Showing Draft Content)

GrapeCity.Wpf.SpreadSheet.CellType.Editors.CalendarButton

CalendarButton Class

Represents a CalendarButton control for GrapeCity.Windows.InputMan.Primitives.CalendarInfo presentation. It represents a month when GrapeCity.Windows.InputMan.GcDropDownCalendar.DisplayMode property is GrapeCity.Windows.InputMan.CalendarMode.Year; represents a year when GrapeCity.Windows.InputMan.GcDropDownCalendar.DisplayMode property is GrapeCity.Windows.InputMan.CalendarMode.Decade.

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 = "CalendarButtonFocused", GroupName = "CalendarButtonFocusStates")]
[TemplateVisualState(Name = "CalendarButtonUnfocused", GroupName = "CalendarButtonFocusStates")]
public sealed class CalendarButton : 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:="CalendarButtonFocused", GroupName:="CalendarButtonFocusStates")>
<TemplateVisualState(Name:="CalendarButtonUnfocused", GroupName:="CalendarButtonFocusStates")>
Public NotInheritable Class CalendarButton
    Inherits Button
    Implements IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, ICommandSource
Remarks

The CalendarButton offered some properties for customizing visual presentation via styling:

The IsInactive indicates whether the CalendarButton is trailing status. The HasSelectedDays indicates whether the dates the CalendarButton represents contains some selected days.

The CalendarButton also offered a CalendarInfo property to deliver more information about the dates 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 HasSelectedDays 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 HasSelectedDays 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.

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
CalendarButton()

Initializes a new instance of the CalendarButton class.

Fields

Name Description
CalendarInfoProperty

Identifies the CalendarInfo DependencyProperty.

HasSelectedDaysProperty

Identifies the HasSelectedDays DependencyProperty.

IsHighlightedProperty

Identifies the IsHighlighted DependencyProperty.

IsInactiveProperty

Identifies the IsInactive DependencyProperty.

Properties

Name Description
CalendarInfo

Gets the GrapeCity.Windows.InputMan.Primitives.CalendarInfo which contains the advanced information of the dates that the CalendarButton represents. This is a dependency property.

HasSelectedDays

Gets a value indicating whether the date range of CalendarInfo contains some days in the selection of GrapeCity.Windows.InputMan.GcDropDownCalendar. This is a dependency property.

IsHighlighted

Gets a value indicating whether this button is highlighted. This is a dependency property.

IsInactive

Gets a value indicating whether this CalendarButton is inactive. This is a dependency property.

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.