ViewDefinitionBase
Provides the foundation for all view definitions in RadScheduler, establishing common properties and behavior for different calendar view types. This abstract class defines how dates, time slots, and appointments are organized and displayed in various scheduler views.
ViewDefinitionBase serves as the base class for all scheduler view types:
- DayViewDefinition: Single day view with time slots
- WeekViewDefinition: Full week view (7 days) with optional weekend display
- MonthViewDefinition: Monthly calendar view
- MultidayViewDefinition: Custom multi-day view (2-10 days)
Each view definition determines:
- How many days are visible at once
- The format and content of header text
- Navigation behavior when moving between time periods
- How appointments are laid out and displayed
View definitions are typically added to the scheduler's ViewDefinitions collection and can be switched between using the ActiveViewDefinitionIndex property or header controls.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public abstract class ViewDefinitionBase : StyleableElement, INotifyPropertyChanged
Inheritance: objectViewDefinitionBase
Derived Classes:
Implements:
Example:
// Adding multiple view definitions to a scheduler
<telerik:RadScheduler>
<telerik:RadScheduler.ViewDefinitions>
<telerik:DayViewDefinition Title="Day" />
<telerik:WeekViewDefinition Title="Full Week" />
<telerik:WeekViewDefinition IsWeekendVisible="False" Title="Work Week" />
<telerik:MonthViewDefinition Title="Month" />
</telerik:RadScheduler.ViewDefinitions>
</telerik:RadScheduler>
Constructors
protected ViewDefinitionBase()
Fields
HeaderTextFormatProperty
BindableProperty
Identifies the HeaderTextFormat property.
public static readonly BindableProperty HeaderTextFormatProperty
TitleProperty
BindableProperty
Identifies the Title bindable property.
public static readonly BindableProperty TitleProperty
Properties
Gets or sets the format string used to display the main header text for this view. This property controls how dates and time ranges are formatted in the scheduler's primary header area.
public string HeaderTextFormat { get; set; }
A format string compatible with DateTime formatting, or null to use the default format for this view type.
The HeaderTextFormat property allows customization of the main date display in the scheduler header. Different view types have different default formats:
- Day view: Typically shows full date (e.g., "Monday, October 16, 2023")
- Week view: Shows date range (e.g., "October 16-22, 2023")
- Month view: Shows month and year (e.g., "October 2023")
The format string should be compatible with standard .NET DateTime format strings. You can use standard format specifiers (d, D, M, Y, etc.) or custom format patterns.
When null or empty, the view definition uses its default formatting logic, which may consider the current culture and localization settings.
Gets or sets the display title for this view definition. This title appears in the scheduler header and view switcher controls, allowing users to identify and select this view.
public string Title { get; set; }
A string representing the user-friendly name for this view. If not explicitly set, a default title may be generated.
If no title is explicitly set, derived classes may provide default titles through the CreateDefaultTitle method. For localization, you can bind this property to localized strings or set it programmatically based on the current culture.
Methods
Creates the default title for the view definition.