CalendarTableElement
Builds and arranges the cell grid used to render a calendar view at its current zoom level.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class CalendarTableElement : CalendarVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementCalendarVisualElementCalendarTableElement...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes the table for a calendar and view and subscribes to view changes.
protected CalendarTableElement(CalendarVisualElement owner, RadCalendar calendar, CalendarView view)
The visual element that contains this table.
calendarRadCalendarThe calendar that supplies selection and layout settings.
viewCalendarViewThe non-null view rendered by the table.
The view's row and column counts are initialized from the calendar before the table's children are created.
protected CalendarTableElement(CalendarVisualElement owner)
Fields
Stores the calendar view currently rendered by the table.
protected CalendarView cachedView
Stores the visual elements that make up the table's cell grid.
protected List<LightVisualElement> visualElements
Properties
enable or disable animation on mouse click
protected bool AllowFadeAndAnimation { get; set; }
Gets the parent calendar that the current view is assigned to.
public override RadCalendar Calendar { get; }
Overrides:
Gets or sets the spacing between cell columns and invalidates the table's arrangement when changed.
protected virtual int CellHorizontalSpacing { get; set; }
Gets or sets the spacing between cell rows and invalidates the table's arrangement when changed.
protected virtual int CellVerticalSpacing { get; set; }
Gets the number of grid columns for the current view or zoom level.
public virtual int Columns { get; }
At the day level this comes from the view; at higher zoom levels it comes from the table's rendered grid.
Gets or sets the calendar zoom level rendered by the table.
public ZoomLevel Level { get; set; }
Values outside the supported range from Days through YearsRange are ignored. A permitted change can be canceled by the calendar's zoom-changing event; an accepted change raises the zoom-changed event and animates the transition.
Gets or sets the parent visual element whose calendar and view context this element can inherit.
protected override CalendarVisualElement Owner { get; set; }
Overrides:
Changing the owner also rewires the calendar mouse and property-change handlers used by the table.
Gets the number of grid rows for the current view or zoom level.
public virtual int Rows { get; }
At the day level this comes from the view; at higher zoom levels it comes from the table's rendered grid.
Gets or sets the visual element most recently recorded from a bubbled cell-click event.
public LightVisualElement SelectedElement { get; set; }
Gets or sets the view rendered by this table.
public override CalendarView View { get; set; }
Overrides:
Assigning a different view transfers the change subscription and forces the cell visuals to refresh.
Methods
Arranges each content cell at the grid position represented by its row and column.
protected virtual void ArrangeContentCells(int xCellSize, int yCellSize, int xOffset, int yOffset)
The horizontal size of a content cell.
yCellSizeintThe vertical size of a content cell.
xOffsetintThe horizontal offset before the content grid.
yOffsetintThe vertical offset before the content grid.
Arranges the row and column headers and the optional top-left view selector.
protected virtual void ArrangeHeaders(int xCellSize, int yCellSize, int xOffset, int yOffset)
The horizontal size of a content cell.
yCellSizeintThe vertical size of a content cell.
xOffsetintThe horizontal space reserved for row headers.
yOffsetintThe vertical space reserved for column headers.
Creates the animation layers used while transitioning between zoom levels.
protected override void CreateChildElements()
Overrides:
Creates the grid cells for the current zoom level and applies the view's cell properties.
protected virtual void CreateVisuals()
The day level uses the view's content offsets and grid dimensions; other zoom levels use a 3-by-4 grid.
Unsubscribes from calendar and view notifications and disposes the cell elements.
protected override void DisposeManagedResources()
Overrides:
Gets the content cell at a grid position after applying the view's content offsets.
Gets the cells in a column, ordered by their position in the visual-element collection.
protected virtual List<CalendarCellElement> GetElementsByColumn(int column)
The zero-based column to search.
Returns:List<CalendarCellElement>
The cells whose column index matches the specified value.
Gets the cells in a row, ordered by their position in the visual-element collection.
protected virtual List<CalendarCellElement> GetElementsByRow(int row)
The zero-based row to search.
Returns:List<CalendarCellElement>
The cells whose row index matches the specified value.
Gets the calendar cells that have been assigned a date.
protected virtual List<CalendarCellElement> GetViewElements()
List<CalendarCellElement>
Cells whose date is not MinValue.
Provides an initialization hook for derived table implementations; the base implementation does nothing.
public virtual void Initialize()
Creates the cell elements for a grid with the specified dimensions.
Creates the optional header cells and attaches the current grid cells and animation layers.
protected virtual void InitializeChildren()
Assigns the calendar-table theme class and disables the base fade animation.
protected override void InitializeFields()
Overrides:
Tracks bubbled cell clicks and optionally animates the clicked cell's parent.
protected override void OnBubbleEvent(RadElement sender, RoutedEventArgs args)
Overrides:
Provides a hook for derived table types to rebuild view-dependent visuals; the base implementation does nothing.
protected virtual void Recreate()
Synchronizes non-header cell selection states with the calendar's selected-date collection.
protected virtual void RefreshSelectedDates()
A selected date is visually selected only when allows the selection style.
Clears transient cell states and reapplies the current view's visual properties.
public override void RefreshVisuals(bool unconditional)
Whether to clear selection state even for dates that remain selected in the current view.
Overrides:
Renders the current cached view at the table's active zoom level.
protected virtual void RenderContent()
Dispatches rendering to the method that corresponds to the active zoom level.
protected virtual void RenderContent(CalendarView view)
The view whose date range and orientation are used when rendering day cells.
Populates the month grid with consecutive months in the focused year.
protected virtual void RenderContentLevelOne(CalendarView view)
The view being rendered.
Populates the years-range grid with dates spaced ten years apart, starting before the focused century.
protected virtual void RenderContentLevelThree(CalendarView view)
The view being rendered.
Populates the year grid with consecutive years, starting one year before the focused decade.
protected virtual void RenderContentLevelTwo(CalendarView view)
The view being rendered.
Populates day cells from the view's rendered date range, accounting for orientation and right-to-left layout.
protected virtual void RenderContentLevelZero(CalendarView view)
The view whose rendered range and orientation determine the day-cell order.
Recreates the cell visuals and reapplies the current view's cell properties.
public virtual void ResetVisuals()
Updates or rebuilds the grid in response to a changed view property.
protected virtual void SetBehaviorOnPropertyChange(string propertyName)
The name of the changed property.
Grid dimensions and header visibility rebuild the visuals; selector-enable flags force a refresh, spacing changes invalidate layout, and selector text or images update the corresponding elements.
Assigns the date and its selection, range, focus, weekend, today, and special-day state to a cell.
protected virtual void SetCalendarCell(LightVisualElement processedCell, DateTime processedDate)
The calendar cell element to populate.
processedDateDateTimeThe date represented by the cell.
Raises the calendar's element-render event after applying the built-in state so handlers can customize the result.