Creating a .NET MAUI Hospital Appointment Booking App
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (172).NET Core  (29).NET MAUI  (186)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (209)BoldSign  (12)DocIO  (24)Essential JS 2  (106)Essential Studio  (199)File Formats  (63)Flutter  (129)JavaScript  (218)Microsoft  (118)PDF  (80)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (871)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (49)Windows Forms  (61)WinUI  (68)WPF  (155)Xamarin  (160)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (145)Chart  (123)Cloud  (14)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (62)Development  (608)Doc  (7)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  (479)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (39)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  (29)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (361)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (30)Visual Studio Code  (17)Web  (572)What's new  (311)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Creating a .NET MAUI Hospital Appointment Booking App

Creating a .NET MAUI Hospital Appointment Booking App

A hospital appointment booking application eliminates the need to visit or call a hospital to schedule an appointment. It allows patients to book appointments with doctors or specialists at their convenience.

This blog post will provide a detailed guide on creating a hospital appointment booking app using Syncfusion .NET MAUI controls. We’ll see the steps to set up the project, design the user interface, and implement the necessary features to enable users to book appointments with their preferred doctors.

We’ll design the hospital appointment booking app by following these steps:

  1. Select specialists.
  2. Confirm the availability of the doctor.
  3. Schedule the appointments.
  4. List all upcoming and previous appointments.

Let’s get started!

Note: Before designing the UI, we need to create a .NET MAUI application.

Step 1: Select specialists

In the Mainpage.xaml page, list the available specialists in the hospital, such as general practitioners, cardiologists, dentists, and others. To design this UI, we’ve used the grid layout. This will enable users to easily select specialists based on their needs.

Refer to the following code example.


<Grid RowDefinitions="auto,0.9*" Background="#b8b8ff"  WidthRequest="{OnPlatform WinUI=500,MacCatalyst=500}" HeightRequest="560" HorizontalOptions="Center" VerticalOptions="Center">
 <Label Text="Select Specialists" FontSize="16" Margin="10" Padding="20,10" VerticalOptions="Start" FontAttributes="Bold"/>
 <Grid Grid.Row="1" ColumnDefinitions="*,*,*" Margin="0,0,0,30"  RowDefinitions="0.3*,0.3*,0.3*">
  <Border VerticalOptions="Center"  Stroke="#f8f7ff" Background="#f8f7ff" StrokeThickness="2" StrokeShape="RoundRectangle 10,10,10,10"  HorizontalOptions="Center" Margin="0" Padding="0">
   <VerticalStackLayout Margin="10">
    <ImageButton AutomationId="General"  x:Name="General" VerticalOptions="Start" Source="general.png" Clicked="ImageButton_Clicked" HeightRequest="100" WidthRequest="90" />
    <Label Text="Physician"  HorizontalOptions="Center"/>

  <Border VerticalOptions="Center"  Stroke="#f8f7ff" Background="#f8f7ff"  Grid.Row="0" Grid.Column="1" StrokeThickness="2" StrokeShape="RoundRectangle 10,10,10,10"  HorizontalOptions="Center" Margin="0" Padding="0">
   <VerticalStackLayout Margin="10">
    <ImageButton AutomationId="skin" VerticalOptions="Start" Source="skin.png" Clicked="ImageButton_Clicked" HeightRequest="100" WidthRequest="90" />
    <Label Text="Skin Specialist" HorizontalOptions="Center"/>

Add the MainPage as ContentTemplate of the FlyoutItem in the AppShell.xaml page.



 <FlyoutItem Title="Doctors" FlyoutIcon="doctor.png"  >
  <ShellContent  ContentTemplate="{DataTemplate local:MainPage}" Route="home" />

After that, set this AppShell page as the MainPage in the App.xaml.cs page.


public App()
   MainPage = new AppShell();
Home Page to Select the Specialists in the .NET MAUI Hospital Booking Desktop App
Home Page to Select the Specialists in the .NET MAUI Hospital Booking Desktop App
Home Page to Select the Specialists in .NET MAUI Hospital Booking Mobile App
Home Page to Select the Specialists in .NET MAUI Hospital Booking Mobile App

Once the user selects a specialist, the UI will navigate to DoctorPage. Refer to the following code example.


private void ImageButton_Clicked(object sender, EventArgs e)
    App.Current.MainPage = new NavigationPage();
    var doctorPage = new DoctorPage();
    var bindingContext = new DoctorInfoRepository((sender as ImageButton).AutomationId.ToString());
    doctorPage.BindingContext = bindingContext;

Step 2: Confirm the availability of the doctor

Here, we’ve selected the Pediatrician specialist from the home page to book an appointment. You can find the doctors available for the hospital visit by selecting a date from the calendar. To achieve this UI, we are going to use Syncfusion .NET MAUI controls.

First, we need to register the Syncfusion handler in the MauiProgram.cs file.



We are going to use the Syncfusion .NET MAUI Calendar and Popup controls to select the dates.


<popup:SfPopup x:Name="popup"  ShowCloseButton="False" ShowFooter="False" ShowHeader="False" HeightRequest="380"  Padding="0" >
   <calendar:SfCalendar TodayHighlightBrush="#9381ff" SelectionBackground="#9381ff" MinimumDate="{Binding MinimumDate}" SelectedDate="{Binding SelectedDate}" MaximumDate="{Binding MaximumDate}" ActionButtonClicked="calendar_ActionButtonClicked" ActionButtonCanceled="calendar_ActionButtonCanceled" SelectionChanged="calendar_SelectionChanged" SelectionMode="Single" WidthRequest="300" VerticalOptions="Start" HorizontalOptions="Center" HeightRequest="360" x:Name="calendar" ShowActionButtons="True" />
  <popup:PopupStyle  CornerRadius="0"/>

We will display the list of doctors based on the date selected using the Syncfusion .NET MAUI ListView.



<listView:SfListView x:Name="listView" Margin="5,0,0,0" VerticalOptions="Start" ItemsSource="{Binding DoctorInfo}" ItemSize="160" >
   <VerticalStackLayout IsClippedToBounds="True" Background="#b8b8ff" Margin="5">
    <Grid Padding="10" ColumnDefinitions="0.3*,0.7*" >
     <ImageButton InputTransparent="True" CornerRadius="5" VerticalOptions="Start" HorizontalOptions="Center" Background="#b8b8ff" Source="{Binding Image}" HeightRequest="80" WidthRequest="80"/>
     <VerticalStackLayout Grid.Column="1" VerticalOptions="Center" >
      <Label Text="{Binding Name}" TextColor="Black" FontAttributes="Bold"  />
      <Label Text="{Binding Department}" TextColor="Black"  />
      <Label Text="{Binding Details}" TextColor="Black" />
    <Button VerticalOptions="Center" TextColor="White" Background="#9381ff" CornerRadius="5" HorizontalOptions="Start" Margin="10,0" Text="Book hospital visit" BindingContext="{Binding}" Clicked="Button_Clicked" />

The following images show the resulting UI behavior.                   

Selecting a Date to Find a Doctor's Availability
Selecting a Date to Find a Doctor’s Availability
Listed Doctors Based on the Selected Date
Listed Doctors Based on the Selected Date

Once the available doctor details are listed, we need to design the Book hospital visit button. When the button is clicked, the app will navigate to the next page, BookingAppointment, to schedule the appointments.

Refer to the following code example.


private void Button_Clicked(object sender, EventArgs e)
    var button = sender as Button;
    App.Current.MainPage = new NavigationPage();
    App.Current.MainPage.Navigation.PushAsync(new BookingAppointment() { BindingContext = button.BindingContext });

Step 3: Schedule the appointments

After confirming the availability of the doctors, schedule a hospital visit by selecting the appropriate date and time. Once the time is confirmed, book the appointment.

Refer to the following code example.


<calendar:SfCalendar Grid.Row="1" Background="white" TodayHighlightBrush="#9381ff" SelectionBackground="#9381ff" x:Name="appointmentBooking" EnablePastDates="False" AllowViewNavigation="False" SelectionChanged="AppointmentBooking_SelectionChanged" BackgroundColor="White" NavigationDirection="Horizontal">
  <calendar:CalendarHeaderView Background="white"/>
   <calendar:CalendarMonthView NumberOfVisibleWeeks="1">
     <calendar:CalendarMonthHeaderView Background="white"/>


<FlexLayout x:Name="flexLayout" Wrap="Wrap" JustifyContent="SpaceAround" AlignItems="Center" VerticalOptions="Center" HorizontalOptions="Center">
  <Style TargetType="Button">
   <Setter  Property="TextColor" Value="Black"/>
   <Setter  Property="BackgroundColor" Value="White"/>
 <Button Text="10:00 AM" Clicked="SlotBooking_Changed"/>
 <Button Text="10:30 AM" Clicked="SlotBooking_Changed"/>
 <Button Text="11:00 AM" Clicked="SlotBooking_Changed"/>
 <Button Text="11:30 AM" Clicked="SlotBooking_Changed"/>
 <Button Text="02:00 PM" Clicked="SlotBooking_Changed"/>
 <Button Text="02:30 PM" Clicked="SlotBooking_Changed"/>
 <Button Text="03:00 PM" Clicked="SlotBooking_Changed"/>
 <Button Text="03:30 PM" Clicked="SlotBooking_Changed"/>
 <Button Text="04:00 PM" Clicked="SlotBooking_Changed"/>

Refer to the following images.

Scheduling Appointments

Scheduling Appointments Alert

Scheduling Appointments
Scheduling Appointments

Once the date and time are selected, navigate to the home page. The booked appointment will be saved in the AppointmentsPage.

Refer to the following code example.


private async void BookAppointment(Syncfusion.Maui.Calendar.SfCalendar calendar, FlexLayout buttonLayout)
   if (calendar.SelectedDate == null)
        Application.Current?.MainPage?.DisplayAlert("Alert !", "Please select a date to book an appointment ", "Ok");

   if (this.timeSlot == string.Empty)
       Application.Current?.MainPage?.DisplayAlert("Alert !", "Please select a time to book an appointment ", "Ok");

   DateTime dateTime = calendar.SelectedDate.Value;
   string dayText = dateTime.ToString("MMMM" + " " + dateTime.Day.ToString() + ", " + dateTime.ToString("yyyy"), CultureInfo.CurrentUICulture);
   string text = "Appointment booked for " + dayText + " " + timeSlot;
   popup.Message = text;

   await Task.Delay(1000);
   popup.IsOpen = false;

   var doctorInfo = this.BindingContext as DoctorInfo;
   doctorInfo.AppointmentTime = Convert.ToDateTime(dayText + " " + timeSlot); ;

   App.Current.MainPage = new NavigationPage();
   App.Current.MainPage.Navigation.PushAsync(new AppShell());

Step 4: List all the upcoming and previous appointments

We also want the user to be able to keep track of upcoming and previous appointments.

Refer to the following code example. In it, we use the Syncfusion .NET MAUI ListView control to add appointments to the Appointments page.


<listView:SfListView x:Name="listView" Grid.Row="1" VerticalOptions="Start" ItemSize="100" >
   <VerticalStackLayout Background="#b8b8ff" IsClippedToBounds="True"  Margin="5">
    <Grid Padding="5" ColumnDefinitions="0.3*,0.7*">
     <ImageButton InputTransparent="True" VerticalOptions="Start" Background="#b8b8ff" Source="{Binding Image}"  HeightRequest="80" WidthRequest="80"/>
     <VerticalStackLayout Grid.Column="1" VerticalOptions="Center" >
      <Label Text="{Binding Name}" FontAttributes="Bold"  TextColor="Black" />
      <Label Text="{Binding Department}"  TextColor="Black" />
      <Label  TextColor="Black">
         <Span Text="Appointment Time: "/>
         <Span Text="{Binding AppointmentTime}"/>

Finally, add the AppointmentsPage as the ContentTemplate of the Flyout item on the AppShell page.



 <FlyoutItem Title="Appointments" FlyoutIcon="appointment.png" >
  <ShellContent   ContentTemplate="{DataTemplate local:AppointmentsPage}" Route="appointments"/>

Refer to the following images.

Viewing Upcoming Appointments in .NET MAUI Hospital Booking App
Viewing Upcoming Appointments in .NET MAUI Hospital Booking App
Viewing Past Appointments in .NET MAUI Hospital Booking App
Viewing Past Appointments in .NET MAUI Hospital Booking App

GitHub reference

For more details, you can download the complete example of creating a .NET MAUI hospital appointment booking app on GitHub.


Thanks for reading! We hope this blog provided valuable insight into creating a hospital appointment booking app using Syncfusion .NET MAUI controls. This powerful framework offers many tools and features to help you easily build high-quality, cross-platform apps.

If you have any comments or suggestions, please share them with us in the comments section below.

If you are not a Syncfusion customer, try our 30-day free trial to see how our components can enhance your projects.

You can also contact us through our support forumsupport portal, or feedback portal. Our team of experts is always here to help you with any issues or challenges that you may encounter.

Test Flight
App Center Badge
Google Play Store Badge
Microsoft Badge
Github Store Badge

Related blogs


Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed
Scroll To Top