[]
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.
[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
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 | |
CommonStates | Pressed | |
CommonStates | MouseOver | Represents the visual appearance when IsMouseOver is true. |
SelectionStates | Selected | Represents the visual appearance when IsHighlighted or HasSelectedDays is true.
|
SelectionStates | Unselected | Represents the visual appearance when IsHighlighted and HasSelectedDays 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. |
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 |
---|---|
CalendarButton() | Initializes a new instance of the CalendarButton class. |
Name | Description |
---|---|
CalendarInfoProperty | Identifies the CalendarInfo DependencyProperty. |
HasSelectedDaysProperty | Identifies the HasSelectedDays DependencyProperty. |
IsHighlightedProperty | Identifies the IsHighlighted DependencyProperty. |
IsInactiveProperty | Identifies the IsInactive DependencyProperty. |
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. |
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. |