In This Article

MonthCalendarItem Class

Represents a month calendar item.

[TemplateVisualState(Name = "Normal", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Disabled", GroupName = "CommonStates")]
[TemplateVisualState(Name = "PointerOver", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Pressed", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Focused", GroupName = "FocusStates")]
[TemplateVisualState(Name = "Unfocused", GroupName = "FocusStates")]
[TemplateVisualState(Name = "Selected", GroupName = "SelectionStates")]
[TemplateVisualState(Name = "SelectedPointerOver", GroupName = "SelectionStates")]
[TemplateVisualState(Name = "Unselected", GroupName = "SelectionStates")]
[TemplateVisualState(Name = "Active", GroupName = "ActiveStates")]
[TemplateVisualState(Name = "Inactive", GroupName = "ActiveStates")]
[TemplateVisualState(Name = "ContainsToday", GroupName = "ContainsTodayStates")]
[TemplateVisualState(Name = "ExcludesToday", GroupName = "ContainsTodayStates")]
public class MonthCalendarItem : ContentControl
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl object

Constructors

MonthCalendarItem()

Initializes an instance of the class.

public MonthCalendarItem()

Properties

Command

The ICommand to execute when the item is tapped.

public ICommand? Command { get; set; }

Property Value

ICommand

CommandParameter

The parameter passed to Command when the item is tapped.

public object? CommandParameter { get; set; }

Property Value

object

ContainsToday

Indicates whether the item contains DateTime.Today.

public bool ContainsToday { get; set; }

Property Value

bool:

true if the item contains DateTime.Today; otherwise false. The default value is false.

Date

The date associated with this item.

public DateTime? Date { get; }

Property Value

DateTime?

IsHeader

Indicates whether the item is a header and shouldn't show visual state highlights.

public bool IsHeader { get; set; }

Property Value

bool:

true if the item is a header and shouldn't show visual state highlights; otherwise, false. The default value is false.

IsInactive

Indicates whether the item is outside of the active view.

public bool IsInactive { get; set; }

Property Value

bool:

true if the item is outside of the active view; otherwise, false. The default value is false.

IsPressed

Indicates whether the item is pressed.

public bool IsPressed { get; }

Property Value

bool:

true if the item is pressed; otherwise, false. The default value is false.

IsSelected

Indicates whether the item is selected.

public bool IsSelected { get; set; }

Property Value

bool:

true if the item is selected; otherwise, false. The default value is false.

Methods

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnGotFocus(RoutedEventArgs)

Invoked whenever an unhandled GotFocus event reaches this element in its route.

protected override void OnGotFocus(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

The RoutedEventArgs that contains the event data.

OnKeyDown(KeyEventArgs)

Invoked when an unhandled System.Windows.Input.Keyboard.KeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

The KeyEventArgs that contains the event data.

OnLostFocus(RoutedEventArgs)

Raises the LostFocus routed event by using the event data that is provided.

protected override void OnLostFocus(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains event data. This event data must contain the identifier for the LostFocus event.

Fields

CommandParameterProperty

Defines the CommandParameter property.

public static readonly DependencyProperty CommandParameterProperty

CommandProperty

Defines the Command property.

public static readonly DependencyProperty CommandProperty

ContainsTodayProperty

Defines the ContainsToday property.

public static readonly DependencyProperty ContainsTodayProperty

IsHeaderProperty

Defines the IsHeader property.

public static readonly DependencyProperty IsHeaderProperty

IsInactiveProperty

Defines the IsInactive property.

public static readonly DependencyProperty IsInactiveProperty

IsPressedProperty

Defines the IsPressed property.

public static readonly DependencyProperty IsPressedProperty

IsSelectedProperty

Defines the IsSelected property.

public static readonly DependencyProperty IsSelectedProperty

Extension Methods