# scheduler-major-minor-tick

> Scheduler sets major and minor ticks with a slider that changes the time slot count.

**Framework:** maui  **Component:** Scheduler  **Variant:** major-minor-tick

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/maui/scheduler-major-minor-tick.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.Maui.Scheduler
dotnet add package Syncfusion.Maui.Sliders
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/scheduler-major-minor-tick/Scheduler.xaml

```xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:model="clr-namespace:MAUI.Controls.Scheduler.MajorMinorTick"
             xmlns:slider="clr-namespace:Syncfusion.Maui.Sliders;assembly=Syncfusion.Maui.Sliders"
             xmlns:schedule="clr-namespace:Syncfusion.Maui.Scheduler;assembly=Syncfusion.Maui.Scheduler"
             x:Class="MAUI.Controls.Scheduler.MajorMinorTick.MajorMinorTickPage"
             x:DataType="model:MajorMinorTickViewModel"
             Title="Scheduler - Major and Minor Tick">
    <Grid RowDefinitions="0.8*,0.2*" Padding="8">
        <schedule:SfScheduler x:Name="Scheduler" View="Week" ShowBusyIndicator="True"
                              IsAppointmentToolTipEnabled="True"
                              AllowAppointmentDrag="True" AppointmentsSource="{Binding Events}"
                              MinimumDateTime="{Binding MinDateTime}" MaximumDateTime="{Binding MaxDateTime}"
                              DisplayDate="{Binding DisplayDate}"
                              AllowOverlap="False"
                              AppointmentEditorMode="Add,Edit"
                              AllowedViews="Day,Week,WorkWeek,TimelineDay,TimelineWeek,TimelineWorkWeek"
                              AllowViewNavigation="True" ShowDatePickerButton="True">
        <schedule:SfScheduler.CellContextMenu>
                    <schedule:MenuItemCollection>
                        <schedule:MenuItem Text="Add"
                                           Command="{x:Static schedule:SchedulerCommands.Add}"
                                           CommandParameter="{Binding}">
                            <schedule:MenuItem.Icon>
                                <FontImageSource Glyph="&#xE70D;"
                                                 FontFamily="MauiMaterialAssets"/>
                            </schedule:MenuItem.Icon>
                        </schedule:MenuItem>
                    </schedule:MenuItemCollection>
                </schedule:SfScheduler.CellContextMenu>
                <schedule:SfScheduler.AppointmentContextMenu>
                    <schedule:MenuItemCollection>
                        <schedule:MenuItem Text="Edit"
                                           Command="{x:Static schedule:SchedulerCommands.Edit}"
                                           CommandParameter="{Binding}">
                            <schedule:MenuItem.Icon>
                                <FontImageSource Glyph="&#xE710;"
                                                 FontFamily="MauiMaterialAssets"/>
                            </schedule:MenuItem.Icon>
                        </schedule:MenuItem>
                        <schedule:MenuItem Text="Delete"
                                           Command="{x:Static schedule:SchedulerCommands.Delete}"
                                           CommandParameter="{Binding}">
                            <schedule:MenuItem.Icon>
                                <FontImageSource Glyph="&#xE70F;"
                                                 FontFamily="MauiMaterialAssets"/>
                            </schedule:MenuItem.Icon>
                        </schedule:MenuItem>
                    </schedule:MenuItemCollection>
                </schedule:SfScheduler.AppointmentContextMenu>
        </schedule:SfScheduler>
        <VerticalStackLayout Grid.Row="1" Padding="0,8">
            <Label Text="Time slot count"
                   FontSize="16"
                   VerticalOptions="Center"
                   HorizontalOptions="Start" />
            <slider:SfSlider x:Name="timeSlotCountSlider"
                             Value="2"
                             Interval="2"
                             ShowTicks="True"
                             ShowLabels="True"
                             MinorTicksPerInterval="1"
                             StepSize="1"
                             Minimum="0"
                             Maximum="6"
                             HorizontalOptions="Start"
                             VerticalOptions="Center"
                             ValueChanged="OnTimeSlotCountValueChanged" />
        </VerticalStackLayout>
    </Grid>
</ContentPage>

```

### src/components/scheduler-major-minor-tick/Scheduler.xaml.cs

```cs
using Syncfusion.Maui.Scheduler;
using Syncfusion.Maui.Sliders;

namespace MAUI.Controls.Scheduler.MajorMinorTick
{
    public partial class MajorMinorTickPage : ContentPage
    {
        /// <summary>
        /// The pixels-per-slot constant used to size each major tick.
        /// Slot height (DaysView) and slot width (TimelineView) = 28 * TimeSlotCount.
        /// </summary>
        private const double PixelsPerSlot = 28d;

        public MajorMinorTickPage()
        {
            InitializeComponent();
            BindingContext = new MajorMinorTickViewModel();

            Scheduler.DaysView.TimeSlotCount = 2;
            Scheduler.TimelineView.TimeSlotCount = 2;
            Scheduler.ViewChanged += OnSchedulerViewChanged;
        }

        /// <summary>
        /// Applies the chosen time slot count to both the days and timeline views.
        /// </summary>
        private void ApplyTimeSlotCount(int timeSlotCount)
        {
            if (timeSlotCount < 2)
            {
                Scheduler.DaysView.TimeSlotCount = timeSlotCount;
                Scheduler.DaysView.TimeIntervalHeight = 50;

                Scheduler.TimelineView.TimeSlotCount = timeSlotCount;
                Scheduler.TimelineView.TimeIntervalWidth = double.NaN;
                return;
            }

            var majorSize = PixelsPerSlot * timeSlotCount;

            Scheduler.DaysView.TimeSlotCount = timeSlotCount;
            Scheduler.DaysView.TimeIntervalHeight = majorSize;

            Scheduler.TimelineView.TimeSlotCount = timeSlotCount;
            Scheduler.TimelineView.TimeIntervalWidth = majorSize;
        }

        private void OnTimeSlotCountValueChanged(object? sender, SliderValueChangedEventArgs e)
        {
            ApplyTimeSlotCount((int)e.NewValue);
        }

        private void OnSchedulerViewChanged(object? sender, SchedulerViewChangedEventArgs args)
        {
            if (args.OldView == args.NewView)
            {
                return;
            }

            ApplyTimeSlotCount((int)timeSlotCountSlider.Value);
        }

        protected override void OnDisappearing()
        {
            base.OnDisappearing();
            Scheduler.ViewChanged -= OnSchedulerViewChanged;
        }
    }
}

```
