Easily Create a Meeting Room Calendar Using Xamarin.Forms Scheduler
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (173).NET Core  (29).NET MAUI  (199)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (211)BoldSign  (13)DocIO  (24)Essential JS 2  (106)Essential Studio  (200)File Formats  (63)Flutter  (132)JavaScript  (219)Microsoft  (118)PDF  (80)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (892)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (50)Windows Forms  (61)WinUI  (68)WPF  (157)Xamarin  (161)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (146)Chart  (127)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (62)Development  (618)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (37)Extensions  (22)File Manager  (6)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (497)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (42)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (379)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (17)Web  (582)What's new  (319)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Easily Create a Meeting Room Calendar using Xamarin.Forms Scheduler

Easily Create a Meeting Room Calendar Using Xamarin.Forms Scheduler

In today’s business world, having a meeting room in the workplace is important. Apart from having it, you’ll have to share it efficiently and without causing conflict among teams, which can be more challenging. The meeting room calendar application allows everyone in your workplace to search for room availability in seconds, allowing for easy room booking among different teams with no time conflicts. Let’s walk through the steps to customize the look and feel of our Syncfusion Xamarin.Forms Scheduler component to design a meeting room calendar.

Designing a Meeting Room Calendar using Xamarin Scheduler
Meeting Room Calendar using Xamarin Scheduler

Multiple resources – overview

In our previous blog, Create a Scheduling App using Scheduler for Xamarin, we got a basic overview of Xamarin.Forms Scheduler and its usage in a real-time scenario. In this blog, I’ll continue with an overview of the multiple resources concept and how to utilize this feature in designing a meeting room calendar.

Designing a meeting room calendar

We are going to display only the Scheduler timeline view in this example. As you get started, there will be some restrictions already set for booking meeting rooms, like being unable to reserve a room if it is already booked during a non-accessible time range, such as lunch or during maintenance.

Also, you can’t edit the past meeting events. For example, you can’t book rooms on dates before the current date.

We have also added the Scheduler custom editor, which is used for appointment editing.

Getting started

Follows these steps to create a resource view Scheduler in your Xamarin.Forms application:

Step 1: Follow the getting started documentation to add a Xamarin.Forms SfSchedule control to your application.

Step 2: Then, make the following property changes in the instance of SfSchedule:

Refer to the following code example.

<syncfusion:SfSchedule x:Name="schedule" 
        ScheduleView = "TimelineView" 
        ShowResourceView="True" 
        ResourceViewMode="Absolute">
</syncfusion:SfSchedule >

Populating resources data

Let’s see how to customize the Scheduler layout to display the meeting rooms. The meeting rooms are defined as resources and each room will be displayed vertically against the common timescale.

Imagine that an office has five meeting rooms within its premises, and everyone should share those rooms. As soon as a person books a room, they own it for the entire booked time range and no other person can reserve the same room during that specific time.

To start with, let’s assume that the resource data holds some common room information such as room name, room ID, and a specific color to denote resource appointments. Apart from the default resource fields, you can also define other custom resource fields such as room capacity and its type by binding resources to any type of IEnumerable source. Specify the ResourceMapping attribute to map the properties in the underlying data source to the schedule resource.

Add the resources collections and bind it to the Xamarin Scheduler using the ScheduleResources property.

Refer to the following code example.

ObservableCollection<MeetingRoomInfo> MeetingRooms = new ObservableCollection<MeetingRoomInfo>();

MeetingRooms.Add(new MeetingRoomInfo() { Name = "Jammy", Id = "5001", Color = Color.FromHex("#FF339933"), Capacity = 15, RoomType = "Conference" });
MeetingRooms.Add(new MeetingRoomInfo() { Name = "Tweety", Id = "5002", Color = Color.FromHex("#FF00ABA9"), Capacity = 5, RoomType = "Cabin" });
MeetingRooms.Add(new MeetingRoomInfo() { Name = "Nestle", Id = "5003", Color = Color.FromHex("#FFE671B8"), Capacity = 6, RoomType = "Cabin" });
MeetingRooms.Add(new MeetingRoomInfo() { Name = "Phoneix", Id = "5004", Color = Color.FromHex("#FF1BA1E2"), Capacity = 20, RoomType = "Conference" });
MeetingRooms.Add(new MeetingRoomInfo() { Name = "Mission", Id = "5005", Color = Color.FromHex("#FFD80073"), Capacity = 10, RoomType = "Conference" });
MeetingRooms.Add(new MeetingRoomInfo() { Name = "Emilia", Id = "5006", Color = Color.FromHex("#FFA2C139"), Capacity = 12, RoomType = "Conference" });
<syncfusion:SfSchedule x:Name="schedule" 
        ScheduleView = "TimelineView" 
        ShowResourceView="True"
        ScheduleResources="{Binding MeetingRooms}" 
        ResourceViewMode="Absolute">
        <syncfusion:SfSchedule.ResourceMapping>
                <syncfusion:ResourceMapping 
                     Name="Name"
                     Id="Id"
                     Color="Color"/>
      </syncfusion:SfSchedule.ResourceMapping>
</syncfusion:SfSchedule >
Meeting Room Calendar Showing Resources
Meeting Room Calendar Showing Resources

Customizing the resource layout

You can customize the resource header through its template property and change its look using the ResourceItemTemplate property.

Refer to the following code example.

<ContentPage.Resources>
    <DataTemplate x:Key="CustomResourceTemplate">
        <StackLayout BackgroundColor="{Binding Color}">
        <Grid Margin="20,20,20,20">
            <Grid.RowDefinitions>
                <RowDefinition Height="0.3*"></RowDefinition>
                <RowDefinition Height="0.2*"></RowDefinition>
                <RowDefinition Height="0.2*"></RowDefinition>
            </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="20"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Label 
                    Grid.Row="2" Grid.Column="0"
                    x:Name="lbl_seats" Text="Seats" TextColor="White"
                    HorizontalOptions="EndAndExpand"
                    HorizontalTextAlignment="End" FontSize="Small">
                    <Label.FontSize>
                        <OnPlatform x:TypeArguments="x:Double">
                            <On Platform="iOS">7</On>
                            <On Platform="Android">7</On>
                            <On Platform="WPF">10</On>
                            <On Platform="UWP">10</On>
                        </OnPlatform>
                    </Label.FontSize>
                </Label>
            <Label Grid.Row="2" Grid.Column="1" x:Name="lbl_capacity"
                   Text="{Binding Capacity}"
                   BackgroundColor="LightGray"
                   TextColor="Black"
                   VerticalTextAlignment="Center" WidthRequest="5" HeightRequest="5"
                   HorizontalTextAlignment="Center">
                <Label.FontSize>
                    <OnPlatform x:TypeArguments="x:Double">
                        <On Platform="iOS">11</On>
                        <On Platform="Android">11</On>
                        <On Platform="WPF">11</On>
                        <On Platform="UWP">11</On>
                    </OnPlatform>
                </Label.FontSize>
            </Label>
                <Label x:Name="lbl_roomname" Text="{Binding Name}" TextColor="White"
                   Grid.Row="0" Grid.ColumnSpan="2" HorizontalTextAlignment="Start" 
                       FontSize="Small" FontAttributes="Bold">
                <Label.FontSize>
                    <OnPlatform x:TypeArguments="x:Double">
                        <On Platform="iOS">14</On>
                        <On Platform="Android">14</On>
                        <On Platform="WPF">14</On>
                        <On Platform="UWP">14</On>
                    </OnPlatform>
                </Label.FontSize>
            </Label>
                <Label x:Name="lbl_roomtype" Text="{Binding RoomType}" TextColor="White"
                   Grid.Row="1" Grid.ColumnSpan="2" HorizontalTextAlignment="Start" FontSize="Small">
                <Label.FontSize>
                    <OnPlatform x:TypeArguments="x:Double">
                        <On Platform="iOS">7</On>
                        <On Platform="Android">7</On>
                        <On Platform="WPF">10</On>
                        <On Platform="UWP">10</On>
                    </OnPlatform>
                </Label.FontSize>
            </Label>
        </Grid>
        </StackLayout>
    </DataTemplate>
</ContentPage.Resources>
<syncfusion:SfSchedule x:Name="schedule" 
        ScheduleView = "TimelineView" 
        ShowResourceView="True"
        ScheduleResources="{Binding MeetingRooms}" 
        ResourceItemTemplate="{StaticResource CustomResourceTemplate}"
        ResourceViewMode="Absolute"/>
Customizing the Meeting Room Calendar
Customizing the Meeting Room Calendar in Xamarin

Populating the meeting data

The header layout customization is over now, and it’s time to fill the Scheduler with room reservation data. Let’s form the data with meeting-related fields such as meeting summary, start time, end time, and location. Then, assign them to the Scheduler DataSource property. Each appointment in the Scheduler denotes a confirmed booking to convey the room reservation status at a specific time.

The Xamarin.Forms Scheduler supports full data binding to all types of IEnumerable sources. Specify the ScheduleAppointmentMapping attributes to map the properties in the underlying data source to the scheduler appointments.

Refer to the following code example.

<syncfusion:SfSchedule x:Name="schedule" 
        DataSource="{Binding Meetings}"                  
        ScheduleView = "TimelineView" 
        ShowResourceView="True"
        ScheduleResources="{Binding MeetingRooms}" 
        ResourceItemTemplate="{StaticResource CustomResourceTemplate}"
        ResourceViewMode="Absolute" >
<syncfusion:SfSchedule.AppointmentMapping>
    <syncfusion:ScheduleAppointmentMapping
            ColorMapping="Color"
            EndTimeMapping="To"
            StartTimeMapping="From"
            SubjectMapping="EventName"
            IsAllDayMapping="IsAllDay"
            RecurrenceRuleMapping="RecurrenceRule"     
            ResourceIdsMapping="ResourceIdCollection"/>
</syncfusion:SfSchedule.AppointmentMapping>
</ syncfusion:SfSchedule>

Blocking reservations on inaccessible cells

Now, we need to concentrate on another important action: making certain cells inaccessible to users. This can be done by adding the  SpecialTimeRegion in the SpecialTimeRegions property.

To prevent the appointment editor from opening inaccessible slots, set the CanEdit property of the TimeRegionSettings as false like in the following code.

<syncfusion:SfSchedule.SpecialTimeRegions>
    <syncfusion:TimeRegionSettings 
            StartHour="13" 
            EndHour="14" 
            Text="Lunch"
            CanEdit="False"
            Color="#EAEAEA"
            TextColor="Black"/>
</syncfusion:SfSchedule.SpecialTimeRegions>

To prevent appointment editor from opening on past dates in the schedule, set the MinDisplayDate to restrict date navigation features, namely Backward and MoveToDate.

<syncfusion:SfSchedule 
        x:Name="schedule" 
        DataSource="{Binding Meetings}"                  
        ScheduleView = "TimelineView" 
        MinDisplayDate="{Binding MinimumDate}” />

Resource

For more information, you can download the complete example for Designing a Meeting Room Calendar using Xamarin.Forms Scheduler.

Summary

To summarize, we have seen how to customize our Syncfusion Xamarin.Forms Scheduler to design a meeting room calendar by using additional styling options. Keep checking up with us, as more useful blogs are waiting in our queue that will show more of the customizing options available in the Scheduler.

If you are an existing Syncfusion user, please download the latest version from the License and Downloads page and try the new features for yourself. Also, our NuGet packages are available on NuGet.org.

If you aren’t a customer yet, you can try our 30-day free trial to check out these features. Also, try our other samples from this GitHub location.

Feel free to share your feedback or questions in the comments section below. You can also contact us through our support forumDirect-Trac, or feedback portal. We are always happy to assist you!

Related blogs

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed