logo

Home

»

Blog Insights

»

How To Display Toast Messages In Xamarin Forms?

How To Display Toast Messages In Xamarin Forms?

Blog Image

Keyur Patel

September 12, 2025

2 min

What is Xamarin?

Xamarin is a tool supported by Microsoft. It provides way to developers to build native mobile applications. Those applications have native features and share common code at the same time.

Why do we need of Xamarin?

As it is developed by Microsoft for creating mobile application, so if you want to be run your same application on various platforms like IOS, Android and windows then you can achieve this by using Xamarin application.

What is the use of Toasts?

Toasts displays message that disappears after sometimes to the users.so messages do not stuck on the screen in mobile applications that is best use of toast.

How to use Toasts in Xamarin application?

First of all, add one interface in main project named as “IToastMessage”.Declare one function named as DisplayMessage(string Message) and pass string parameter to that method.

 

How to use Toasts in Xamarin android application?

First of all, add one class named as “Message_Driod.cs” in android application project and implement “IToastMessage” interface as below:

 

For “IToastMessage” interface give reference of your main project where you have created your interface to your android application project by right click on Reference folder of your android application project, then select add reference and click on project tab then select your main project and press ok.

How to use Toasts in Xamarin IOS application?

First of all, add one class named as “Message_IOS.cs” in android application project and implement “IToastMessage” interface as below:

 

For “IToastMessage” interface give reference of your main project where you have created your interface to your android application project by right click on Reference folder of your android application project, then select add reference and click on project tab then select your main project and press ok.

How to display Toasts in Xamarin Application?

Now You can display toast by using below code in main project code files:DependencyService.Get<IToastMessage>().DisplayMessage(“Your message here.”);

author

Keyur Patel

Co-Founder

Keyur Patel is the director at IT Path Solutions, where he helps businesses develop scalable applications. With his extensive experience and visionary approach, he leads the team to create futuristic solutions. Keyur Patel has exceptional leadership skills and technical expertise in Node.js, .Net, React.js, AI/ML, and PHP frameworks. His dedication to driving digital transformation makes him an invaluable asset to the company.

Get in Touch

Name

Phone

Company

Email

Message

All projects confidential information will be secured by NDA & under your IP rights.

By submitting, you agree to occasional emails (see our privacy policy for details).

Search

Related Blog Posts