Version

Getting Started (XamScheduler)

Purpose

This topic provides information on how to get started with the XamScheduler control in your applications.

Required Background

Topic Purpose

This topic provides an overview of the XamScheduler control.

In This Topic

Overview

The steps below will guide you on how to quickly setup a XamScheduler in your page showing one appointment.

The following image is a preview of the result:

Scheduler 03.png

Steps

  1. Create a Xamarin.Forms application project.

  2. Add References Through NuGet Packages.

  3. Create new Forms Content Page Xaml

  4. In the page XAML add the following namespace:

    In XAML:

    xmlns:igScheduler="clr-namespace:Infragistics.XamarinForms.Controls.Scheduler;assembly=Infragistics.XF.Scheduler"
  5. Add the XamScheduler definition in the content grid:

    In XAML:

    <Grid>
        <igScheduler:XamScheduler x:Name="scheduler" />
    </Grid>
  6. Open the page’s code-behind and add the following namespace:

    In C#:

    using Infragistics.Scheduler;
    using Infragistics.XamarinForms.Controls.Scheduler;
  7. Create a private method for populating the XamScheduler's activities:

    In C#:

    private void PopulateActivities()
    {
        DateTime today = DateTime.Now.Date;
    
        // Create an appointment
        Appointment appointment1 = new Appointment();
        appointment1.Subject = "Team Meeting";
        appointment1.Location = "Conf. Room #3";
        appointment1.Start = new DateTime(today.Year, today.Month, today.Day, 10, 0, 0);
        appointment1.End = new DateTime(today.Year, today.Month, today.Day, 10, 30, 0);
    
    
        // Create a list of appointment
        ObservableCollection<Appointment> appointments = new ObservableCollection<Appointment>();
        appointments.Add(appointment1);
    
        // Create a ScheduleListDataSource instance
        ScheduleListDataSource dataSource = new ScheduleListDataSource();
        dataSource.AppointmentItemsSource = appointments;
    
        // Set the data source to the control
        this.scheduler.DataSource = dataSource;
    }
  8. Invoke the method defined in the previous step just after the InitializeComponent() invocation in the page’s constructor.

    In C#:

    PopulateActivities();
  9. Build, deploy and run your application.

Related Topics

Topic Purpose

The topics in this section explain different ways to populate the XamScheduler control with data.

The topics in this section provide information about the different views used by the XamScheduler control to present data.

The topics in this section provide information about the activities concept of the XamScheduler control.

This topic provides information about the resources concept of the XamScheduler control.