Class
MultidayViewDefinitionBase

Represents abstract definition of a view that shows multiple days. This base class provides common functionality for all multi-day scheduler views, including day view, week view, and custom multi-day views. It defines time ranges, tick intervals, styling options, and special slot handling.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public abstract class MultidayViewDefinitionBase : ViewDefinitionBase, INotifyPropertyChanged

Inheritance: objectViewDefinitionBaseMultidayViewDefinitionBase

Derived Classes: DayViewDefinitionMultidayViewDefinitionWeekViewDefinition

Implements: INotifyPropertyChanged

Inherited Members ViewDefinitionBase.TitlePropertyViewDefinitionBase.HeaderTextFormatPropertyViewDefinitionBase.TitleViewDefinitionBase.HeaderTextFormat

Constructors

MultidayViewDefinitionBase()

Initializes a new instance of the MultidayViewDefinitionBase class. Sets up default style selectors and configures the current time indicator based on visibility settings.

Declaration

cs-api-definition
public MultidayViewDefinitionBase()

Fields

DayEndTimeProperty

Identifies the DayEndTime property.

Declaration

cs-api-definition
public static readonly BindableProperty DayEndTimeProperty

Field Value

BindableProperty

DayStartTimeProperty

Identifies the DayStartTime property.

Declaration

cs-api-definition
public static readonly BindableProperty DayStartTimeProperty

Field Value

BindableProperty

DayStringFormatProperty

Identifies the DayStringFormat bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty DayStringFormatProperty

Field Value

BindableProperty

DayStyleSelectorProperty

Identifies the DayStyleSelector property.

Declaration

cs-api-definition
public static readonly BindableProperty DayStyleSelectorProperty

Field Value

BindableProperty

HorizontalLineStyleProperty

Identifies the HorizontalLineStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty HorizontalLineStyleProperty

Field Value

BindableProperty

IsCurrentTimeIndicatorVisibleProperty

Identifies the IsCurrentTimeIndicatorVisible property.

Declaration

cs-api-definition
public static readonly BindableProperty IsCurrentTimeIndicatorVisibleProperty

Field Value

BindableProperty

LinesThicknessProperty

Identifies the LinesThickness property.

Declaration

cs-api-definition
public static readonly BindableProperty LinesThicknessProperty

Field Value

BindableProperty

MajorTickLengthProperty

Identifies the MajorTickLength property.

Declaration

cs-api-definition
public static readonly BindableProperty MajorTickLengthProperty

Field Value

BindableProperty

MajorTickLineStyleProperty

Identifies the MajorTickLineStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty MajorTickLineStyleProperty

Field Value

BindableProperty

MaxTimeRulerExtentProperty

Identifies the MaxTimeRulerExtent property.

Declaration

cs-api-definition
public static readonly BindableProperty MaxTimeRulerExtentProperty

Field Value

BindableProperty

MinTimeRulerExtentProperty

Identifies the MinTimeRulerExtent property.

Declaration

cs-api-definition
public static readonly BindableProperty MinTimeRulerExtentProperty

Field Value

BindableProperty

MinorTickLengthProperty

Identifies the MinorTickLength property.

Declaration

cs-api-definition
public static readonly BindableProperty MinorTickLengthProperty

Field Value

BindableProperty

MinorTickLineStyleProperty

Identifies the MinorTickLineStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty MinorTickLineStyleProperty

Field Value

BindableProperty

SpecialSlotStyleSelectorProperty

Identifies the SpecialSlotStyleSelector property.

Declaration

cs-api-definition
public static readonly BindableProperty SpecialSlotStyleSelectorProperty

Field Value

BindableProperty

SpecialSlotTemplateProperty

Identifies the SpecialSlotTemplate property.

Declaration

cs-api-definition
public static readonly BindableProperty SpecialSlotTemplateProperty

Field Value

BindableProperty

SpecialSlotsSourceProperty

Identifies the SpecialSlotsSource property.

Declaration

cs-api-definition
public static readonly BindableProperty SpecialSlotsSourceProperty

Field Value

BindableProperty

TimeRulerLabelStyleProperty

Identifies the TimeRulerLabelStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty TimeRulerLabelStyleProperty

Field Value

BindableProperty

TimeRulerMajorTickStringFormatProperty

Identifies the TimeRulerMajorTickStringFormat bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty TimeRulerMajorTickStringFormatProperty

Field Value

BindableProperty

TimeRulerWidthProperty

Identifies the TimeRulerWidth bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty TimeRulerWidthProperty

Field Value

BindableProperty

VerticalLineStyleProperty

Identifies the VerticalLineStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty VerticalLineStyleProperty

Field Value

BindableProperty

Properties

DayEndTime

Gets or sets the time used to indicate the end of the day. This property defines when the visible time range ends in the scheduler view. Appointments and time slots after this time will not be displayed.

Declaration

cs-api-definition
public TimeOnly DayEndTime { get; set; }

Property Value

TimeOnly

A TimeOnly value representing the end of the visible day. Default is TimeOnly.MaxValue (23:59:59).

Example

csharp
// End the day at 6:00 PM
viewDefinition.DayEndTime = new TimeOnly(18, 0);

// End the day at 10:30 PM
viewDefinition.DayEndTime = new TimeOnly(22, 30);

// Late evening end
viewDefinition.DayEndTime = TimeOnly.FromTimeSpan(TimeSpan.FromHours(23.5)); // 11:30 PM

DayStartTime

Gets or sets the time used to indicate the start of the day. This property defines when the visible time range begins in the scheduler view. Appointments and time slots before this time will not be displayed.

Declaration

cs-api-definition
public TimeOnly DayStartTime { get; set; }

Property Value

TimeOnly

A TimeOnly value representing the start of the visible day. Default is TimeOnly.MinValue (00:00).

Example

csharp
// Start the day at 8:00 AM
viewDefinition.DayStartTime = new TimeOnly(8, 0);

// Start the day at 6:30 AM
viewDefinition.DayStartTime = new TimeOnly(6, 30);

// Early morning start
viewDefinition.DayStartTime = TimeOnly.FromTimeSpan(TimeSpan.FromHours(5.5)); // 5:30 AM

DayStringFormat

Gets or sets the string format of the header days. This property controls how day information is displayed in the day headers, allowing customization of date presentation across different cultures and preferences.

Declaration

cs-api-definition
public string DayStringFormat { get; set; }

Property Value

string

A format string used to display day information. Uses standard .NET date format strings.

Example

csharp
// Show day abbreviation and date (default)
viewDefinition.DayStringFormat = "ddd M/d";  // "Mon 12/25"

// Show full day name
viewDefinition.DayStringFormat = "dddd";     // "Monday"

// Show date only
viewDefinition.DayStringFormat = "M/d";      // "12/25"

// Show day and full date
viewDefinition.DayStringFormat = "ddd, MMM d"; // "Mon, Dec 25"

// Custom format with day number only
viewDefinition.DayStringFormat = "d";        // "25"

DayStyleSelector

Gets or sets the style selector of the days. The day style selector allows conditional styling of day headers based on day state, such as highlighting today differently from other days.

Declaration

cs-api-definition
public IStyleSelector DayStyleSelector { get; set; }

Property Value

IStyleSelector

An IStyleSelector that provides styles for day headers.

Example

csharp
// Create custom day style selector
var daySelector = new DayStyleSelector
{
    NormalLabelStyle = new Style(typeof(Label))
    {
        Setters =
        {
            new Setter { Property = Label.TextColorProperty, Value = Colors.Black },
            new Setter { Property = Label.FontSizeProperty, Value = 14 }
        }
    },
    TodayLabelStyle = new Style(typeof(Label))
    {
        Setters =
        {
            new Setter { Property = Label.TextColorProperty, Value = Colors.Blue },
            new Setter { Property = Label.FontSizeProperty, Value = 16 },
            new Setter { Property = Label.FontAttributesProperty, Value = FontAttributes.Bold }
        }
    }
};

viewDefinition.DayStyleSelector = daySelector;

HorizontalLineStyle

Gets or sets the style of the horizontal lines. Horizontal lines separate time periods and create the grid structure that helps users align appointments with specific times.

Declaration

cs-api-definition
public Style HorizontalLineStyle { get; set; }

Property Value

Style

A Style object defining the appearance of horizontal grid lines.

Example

csharp
// Define horizontal grid line style
var horizontalLineStyle = new Style(typeof(BoxView))
{
    Setters =
    {
        new Setter { Property = BoxView.ColorProperty, Value = Colors.LightGray },
        new Setter { Property = BoxView.HeightRequestProperty, Value = 1 },
        new Setter { Property = BoxView.OpacityProperty, Value = 0.3 }
    }
};

viewDefinition.HorizontalLineStyle = horizontalLineStyle;

IsCurrentTimeIndicatorVisible

Gets or sets a value indicating whether the current time indicator is visible. When enabled, displays a line or marker showing the current time position within the scheduler view, updating automatically as time progresses.

Declaration

cs-api-definition
public bool IsCurrentTimeIndicatorVisible { get; set; }

Property Value

bool

True to show the current time indicator, false to hide it. Default is true.

Example

csharp
// Show current time indicator (default)
viewDefinition.IsCurrentTimeIndicatorVisible = true;

// Hide current time indicator for static views
viewDefinition.IsCurrentTimeIndicatorVisible = false;

// Conditional visibility based on view type
if (viewDefinition is DayViewDefinition)
{
    viewDefinition.IsCurrentTimeIndicatorVisible = true;  // Show for day view
}
else
{
    viewDefinition.IsCurrentTimeIndicatorVisible = false; // Hide for other views
}

LinesThickness

Gets or sets the thickness of the lines. This property controls the visual weight of grid lines, affecting the overall appearance and readability of the scheduler layout.

Declaration

cs-api-definition
public double LinesThickness { get; set; }

Property Value

double

A double value representing line thickness in device-independent units. Default varies by platform.

Example

csharp
// Thin lines for subtle grid
viewDefinition.LinesThickness = 0.5;

// Standard thickness
viewDefinition.LinesThickness = 1.0;

// Bold lines for high contrast
viewDefinition.LinesThickness = 2.0;

// Very subtle grid
viewDefinition.LinesThickness = 0.25;

MajorTickLength

Gets or sets the length of the major ticks. Major ticks represent the primary time intervals displayed in the time ruler and typically show hour boundaries with visible labels.

Declaration

cs-api-definition
public TimeSpan MajorTickLength { get; set; }

Property Value

TimeSpan

A TimeSpan representing the interval between major ticks. Default is 1 hour.

Example

csharp
// 1-hour major ticks (default)
viewDefinition.MajorTickLength = TimeSpan.FromHours(1);

// 2-hour major ticks for a more compressed view
viewDefinition.MajorTickLength = TimeSpan.FromHours(2);

// 30-minute major ticks for detailed view
viewDefinition.MajorTickLength = TimeSpan.FromMinutes(30);

// 15-minute major ticks for very detailed scheduling
viewDefinition.MajorTickLength = new TimeSpan(0, 15, 0);

MajorTickLineStyle

Gets or sets the style of the major lines. Major tick lines correspond to major time intervals (typically hours) and are usually more prominent than minor tick lines.

Declaration

cs-api-definition
public Style MajorTickLineStyle { get; set; }

Property Value

Style

A Style object defining the appearance of major tick lines.

Example

csharp
// Define a custom major tick line style
var majorLineStyle = new Style(typeof(BoxView))
{
    Setters =
    {
        new Setter { Property = BoxView.ColorProperty, Value = Colors.DarkGray },
        new Setter { Property = BoxView.HeightRequestProperty, Value = 2 }
    }
};

viewDefinition.MajorTickLineStyle = majorLineStyle;

MaxTimeRulerExtent

Gets or sets the maximum size of the time ruler in pixels.

Declaration

cs-api-definition
public double MaxTimeRulerExtent { get; set; }

Property Value

double

The maximum size of the time ruler in pixels.

Remarks

This property determines the maximum size of the time ruler in pixels. MaxTimeRulerExtent of 1400 pixels means that the time ruler will be rendered with no more than 1400 pixels no matter how much time it represents. If there is less than 1400 pixels available, it will be squeezed as much as the value of the MinTimeRulerExtent property allows to.

MinTimeRulerExtent

Gets or sets the minimum size of the time ruler in pixels.

Declaration

cs-api-definition
public double MinTimeRulerExtent { get; set; }

Property Value

double

The minimum size of the time ruler in pixels.

Remarks

This property determines the minimum size of the time ruler in pixels. MinTimeRulerExtent of 1400 pixels means that the time ruler will be rendered with at least 1400 pixels no matter how much time it represents. If there is more than 1400 pixels available, it will be stretched as much as the value of the MaxTimeRulerExtent property allows to.

MinorTickLength

Gets or sets the length of the minor ticks. Minor ticks represent secondary time intervals displayed between major ticks, providing finer granularity for time positioning without labels.

Declaration

cs-api-definition
public TimeSpan MinorTickLength { get; set; }

Property Value

TimeSpan

A TimeSpan representing the interval between minor ticks. Default is 30 minutes.

Example

csharp
// 30-minute minor ticks (default) with 1-hour major ticks
viewDefinition.MajorTickLength = TimeSpan.FromHours(1);
viewDefinition.MinorTickLength = TimeSpan.FromMinutes(30);

// 15-minute minor ticks for more granular positioning
viewDefinition.MinorTickLength = TimeSpan.FromMinutes(15);

// 10-minute minor ticks for very precise scheduling
viewDefinition.MinorTickLength = TimeSpan.FromMinutes(10);

// 5-minute minor ticks for detailed medical scheduling
viewDefinition.MinorTickLength = new TimeSpan(0, 5, 0);

MinorTickLineStyle

Gets or sets the style of the minor lines. Minor tick lines appear between major ticks and provide finer time granularity. They are typically styled to be less prominent than major tick lines.

Declaration

cs-api-definition
public Style MinorTickLineStyle { get; set; }

Property Value

Style

A Style object defining the appearance of minor tick lines.

Example

csharp
// Define a subtle minor tick line style
var minorLineStyle = new Style(typeof(BoxView))
{
    Setters =
    {
        new Setter { Property = BoxView.ColorProperty, Value = Colors.LightGray },
        new Setter { Property = BoxView.HeightRequestProperty, Value = 1 },
        new Setter { Property = BoxView.OpacityProperty, Value = 0.5 }
    }
};

viewDefinition.MinorTickLineStyle = minorLineStyle;

SpecialSlotStyleSelector

Gets or sets the style selector of the special slots. Special slot style selector enables conditional styling of special time periods based on slot properties, such as read-only state or custom slot types.

Declaration

cs-api-definition
public IStyleSelector SpecialSlotStyleSelector { get; set; }

Property Value

IStyleSelector

An IStyleSelector that provides styles for special slots.

Example

csharp
// Create custom special slot style selector
var specialSlotSelector = new SpecialSlotStyleSelector
{
    NormalStyle = new Style(typeof(SchedulerBoxView))
    {
        Setters =
        {
            new Setter { Property = SchedulerBoxView.ColorProperty, Value = Colors.LightBlue },
            new Setter { Property = SchedulerBoxView.OpacityProperty, Value = 0.3 }
        }
    },
    ReadOnlyStyle = new Style(typeof(SchedulerBoxView))
    {
        Setters =
        {
            new Setter { Property = SchedulerBoxView.ColorProperty, Value = Colors.Red },
            new Setter { Property = SchedulerBoxView.OpacityProperty, Value = 0.5 }
        }
    }
};

viewDefinition.SpecialSlotStyleSelector = specialSlotSelector;

SpecialSlotTemplate

Gets or sets the template of the special slots. Special slot template allows complete customization of special slot appearance beyond simple styling, enabling complex content and layouts.

Declaration

cs-api-definition
public DataTemplate SpecialSlotTemplate { get; set; }

Property Value

DataTemplate

A DataTemplate that defines the visual structure for special slots.

Example

csharp
// Define custom special slot template
var specialSlotTemplate = new DataTemplate(() =>
{
    var grid = new Grid
    {
        BackgroundColor = Colors.LightYellow,
        Children =
        {
            new Label
            {
                Text = "BREAK",
                FontSize = 10,
                TextColor = Colors.DarkRed,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center
            }
        }
    };
    return grid;
});

viewDefinition.SpecialSlotTemplate = specialSlotTemplate;

SpecialSlotsSource

Gets or sets the special slots source. Special slots are used to highlight specific time periods with different styling, such as lunch breaks, holidays, maintenance windows, or unavailable periods.

Declaration

cs-api-definition
public IEnumerable<Slot> SpecialSlotsSource { get; set; }

Property Value

IEnumerable<Slot>

An enumerable collection of Slot objects defining special time periods.

Example

csharp
// Define lunch break slots
var lunchSlots = new List<Slot>
{
    new Slot
    {
        Start = DateTime.Today.AddHours(12),     // 12:00 PM
        End = DateTime.Today.AddHours(13),       // 1:00 PM
        IsReadOnly = true
    }
};

// Define maintenance window
var maintenanceSlots = new List<Slot>
{
    new Slot
    {
        Start = DateTime.Today.AddHours(2),      // 2:00 AM
        End = DateTime.Today.AddHours(4),        // 4:00 AM
        IsReadOnly = true,
        RecurrencePattern = "FREQ=DAILY"         // Daily recurrence
    }
};

viewDefinition.SpecialSlotsSource = lunchSlots.Concat(maintenanceSlots);

TimeRulerLabelStyle

Gets or sets the style of the time ruler labels. Time ruler labels display time information alongside major ticks, helping users identify specific times for appointment scheduling.

Declaration

cs-api-definition
public Style TimeRulerLabelStyle { get; set; }

Property Value

Style

A Style object defining the appearance of time labels in the time ruler.

Example

csharp
// Define time ruler label style
var timeRulerStyle = new Style(typeof(Label))
{
    Setters =
    {
        new Setter { Property = Label.FontSizeProperty, Value = 12 },
        new Setter { Property = Label.TextColorProperty, Value = Colors.Gray },
        new Setter { Property = Label.FontFamilyProperty, Value = "Arial" },
        new Setter { Property = Label.HorizontalTextAlignmentProperty, Value = TextAlignment.Center }
    }
};

viewDefinition.TimeRulerLabelStyle = timeRulerStyle;

TimeRulerMajorTickStringFormat

Gets or sets the string format of the major ticks. This property controls how time information is displayed in the time ruler for major tick marks, allowing customization of time presentation.

Declaration

cs-api-definition
public string TimeRulerMajorTickStringFormat { get; set; }

Property Value

string

A format string used to display time information. Uses standard .NET time format strings.

Example

csharp
// 12-hour format with AM/PM (default)
viewDefinition.TimeRulerMajorTickStringFormat = "h tt";      // "8 AM", "2 PM"

// 24-hour format
viewDefinition.TimeRulerMajorTickStringFormat = "HH:mm";     // "08:00", "14:00"

// 12-hour with minutes
viewDefinition.TimeRulerMajorTickStringFormat = "h:mm tt";   // "8:00 AM", "2:30 PM"

// Short format
viewDefinition.TimeRulerMajorTickStringFormat = "H";         // "8", "14"

// Custom format
viewDefinition.TimeRulerMajorTickStringFormat = "HH'h'";     // "08h", "14h"

TimeRulerWidth

Gets or sets the width of the TimeRuler. This property controls the horizontal space allocated to the time ruler, affecting how much room is available for time labels and the overall layout balance.

Declaration

cs-api-definition
public double TimeRulerWidth { get; set; }

Property Value

double

A double value representing the width in device-independent units. Must be non-negative.

Example

csharp
// Standard width (default)
viewDefinition.TimeRulerWidth = 80;

// Narrow time ruler for more appointment space
viewDefinition.TimeRulerWidth = 60;

// Wide time ruler for detailed time labels
viewDefinition.TimeRulerWidth = 100;

// Minimal time ruler
viewDefinition.TimeRulerWidth = 40;

// Hide time ruler completely
viewDefinition.TimeRulerWidth = 0;

VerticalLineStyle

Gets or sets the style of the vertical lines. Vertical lines separate different days in multi-day views, providing visual boundaries between day columns.

Declaration

cs-api-definition
public Style VerticalLineStyle { get; set; }

Property Value

Style

A Style object defining the appearance of vertical separator lines.

Example

csharp
// Define vertical separator style
var verticalLineStyle = new Style(typeof(BoxView))
{
    Setters =
    {
        new Setter { Property = BoxView.ColorProperty, Value = Colors.Gray },
        new Setter { Property = BoxView.WidthRequestProperty, Value = 1 }
    }
};

viewDefinition.VerticalLineStyle = verticalLineStyle;

Methods

CreateDefaultTitle()

Creates the default title for the view definition.

Declaration

cs-api-definition
protected override string CreateDefaultTitle()

Returns

string

Overrides ViewDefinitionBase.CreateDefaultTitle()