{"id":558,"date":"2020-09-03T09:42:39","date_gmt":"2020-09-03T09:42:39","guid":{"rendered":"https:\/\/serkanseker.com\/?p=558"},"modified":"2021-02-23T07:14:44","modified_gmt":"2021-02-23T07:14:44","slug":"xamarin-forms-popup","status":"publish","type":"post","link":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/","title":{"rendered":"How To Display Popup Message in Xamarin.Forms"},"content":{"rendered":"\n<p>We all know what <strong>popup <\/strong>is. We use popups when the user needs to confirm or reject a selection. Or sometimes we display it in the middle of the screen to show warning messages. Thus, we aim to increase the user experience of the mobile application. So <strong>popups <\/strong>are very important for a mobile application.<\/p>\n\n\n\n<p>At the end of this article, you will be able to show popups in a Xamarin.Forms applications. You will also customize the layout of popups and add animation. This time, I will make use of one of the <a href=\"https:\/\/serkanseker.com\/best-nuget-packages\/\" target=\"_blank\" rel=\"noreferrer noopener\">most useful plugins<\/a>, Syncfusion.Xamarin.SfPopupLayout, not with Xamarin&#8217;s own controls.<\/p>\n\n\n\n<p>So, let\u2019s started. Follow the steps below in order.<\/p>\n\n\n\n<div class=\"schema-how-to wp-block-yoast-how-to-block\"><p class=\"schema-how-to-description\"><\/p> <ol class=\"schema-how-to-steps\"><li class=\"schema-how-to-step\" id=\"how-to-step-1614012713115\"><strong class=\"schema-how-to-step-name\"><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#step-1\">Install Syncfusion.Xamarin.SfPopupLayout Plugin<\/a><\/strong> <p class=\"schema-how-to-step-text\"><\/p> <\/li><li class=\"schema-how-to-step\" id=\"how-to-step-1614012731464\"><strong class=\"schema-how-to-step-name\"><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#step-2\">Launch the SfPopupLayout on Each Platform<\/a><\/strong> <p class=\"schema-how-to-step-text\"><\/p> <\/li><li class=\"schema-how-to-step\" id=\"how-to-step-1614012770101\"><strong class=\"schema-how-to-step-name\"><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#step-3\">Consume SfPopupLayout in XAML<\/a><\/strong> <p class=\"schema-how-to-step-text\"><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#simple-popup\">1<\/a>)<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#simple-popup\">Create Simple Popup<br\/><\/a><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#customize-popup\">2<\/a>)<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#customize-popup\">Customize Popup Layouts<br\/><\/a><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#popup-animations\">3<\/a>)<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#popup-animations\">Popup Animations<br\/><\/a><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#full-screen-popup\">4<\/a>)<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#full-screen-popup\">Full Screen Popup<\/a><\/p> <\/li><li class=\"schema-how-to-step\" id=\"how-to-step-1614012928482\"><strong class=\"schema-how-to-step-name\"><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#conclusion\">Conclusion<\/a><\/strong> <p class=\"schema-how-to-step-text\"><\/p> <\/li><\/ol><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1\">Step 1 &#8211; Install Syncfusion.Xamarin.SfPopupLayout Plugin<\/h2>\n\n\n\n<p>First, you need to install <a href=\"https:\/\/www.nuget.org\/packages\/Syncfusion.Xamarin.SfPopupLayout\" target=\"_blank\" rel=\"noreferrer noopener\">Syncfusion.Xamarin.SfPopupLayout<\/a> plugin in your Xamarin.Forms project. There are two ways to do this. You can find details in the <a href=\"https:\/\/serkanseker.com\/install-and-manage-nuget-packages\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Install and Manage NuGet Packages<\/a> article.<\/p>\n\n\n\n<p>Type the following code into Package Manager Console and run it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Install-Package Syncfusion.Xamarin.SfPopupLayout -Version 18.4.0.32<\/code><\/pre>\n\n\n\n<p>Alternatively, you can install the plugin from NuGet Package Manager. First, right click on the project folder. Then click on Manage NuGet Packages for Solution option. Go to the Browse tab in the window that opens. Finally, type Syncfusion.Xamarin.SfPopupLayout in the Search bar and search. And install the plugin on all platforms.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/09\/Syncfusion.Xamarin.SfPopupLayout.jpg\" alt=\"Syncfusion.Xamarin.SfPopupLayout\" class=\"wp-image-560\" width=\"734\" height=\"452\"\/><figcaption>Install Syncfusion.Xamarin.SfPopupLayout Plugin<\/figcaption><\/figure><\/div>\n\n\n\n<p>If you use Syncfusion plugins in the project without Registration License, you will get a warning popup. To use this plugin without any warning messages, you must register with Syncfusion and obtain a Registration License. I explained <a href=\"https:\/\/serkanseker.com\/syncfusion-community-license-key\/\" target=\"_blank\" rel=\"noreferrer noopener\">how to register for Syncfusion and get License<\/a>.<\/p>\n\n\n\n<p>Let me explain briefly as follows.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>First create an account in Syncfusion. <\/li><li>Then get a Registration License for Xamarin.Forms apps.<\/li><li> Finally, add this license to the <strong>App()<\/strong> constructor method of <strong>App.xaml.cs<\/strong> class as follows.<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">public App()\n{\n    Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(&quot;YOUR REGISTER LICENCE&quot;);\n    InitializeComponent();\n    MainPage = new AppShell();\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2\">Step 2 &#8211; Launch the SfPopupLayout on Each Platform<\/h2>\n\n\n\n<p>To use the SfPopupLayout plugin in Xamarin, you must launch it on a platform specific. So, after installing the plugin, you cannot use it directly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Android<\/h3>\n\n\n\n<p>To launch the SfPopupLayout plugin on the Android platform, go to the MainActivity.cs class. Then call the Init() method inside the onCreate () method. As follows. Thus, SfPopupLayout will initialize every time MainActivity launch.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">protected override void OnCreate(Bundle bundle)\n{\n    ...\n    global::Xamarin.Forms.Forms.Init(this, bundle);\n    Syncfusion.XForms.Android.PopupLayout.SfPopupLayoutRenderer.Init();\n    LoadApplication(new App());\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">iOS<\/h3>\n\n\n\n<p>To launch the SfPopupLayout plugin on the iOS platform, go to the AppDelegate.cs class. Then call the Init () method inside the FinishedLaunching () method. As follows. Thus, every time the AppDelegate class launch, the SfPopupLayout plugin will also initialize.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">public override bool FinishedLaunching(UIApplication app, NSDictionary options)\n{\n    \u2026\n    global::Xamarin.Forms.Forms.Init ();\n    Syncfusion.XForms.iOS.PopupLayout.SfPopupLayoutRenderer.Init();\n    LoadApplication (new App ());\n    \u2026\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3\">Step 3 &#8211; Consume SfPopupLayout in XAML<\/h2>\n\n\n\n<p>After installing the plugin and launching it on a platform specific, it&#8217;s time to make a sample. In this step, I will first create a simple popup with the SfPopupLayout plugin. Later I will customize this popup. Next, I&#8217;ll create a full screen popup. And finally, I&#8217;ll show you how to animate popups.<\/p>\n\n\n\n<p>Now, you need a ContentPage to show popups. Right click on the project folder and add a ContentPage named PopupPage.xaml.<\/p>\n\n\n\n<p>Then you need to add the sfPopup namespace to ContentPage. Because the namespace is required to create views with the SfPopupLayout plugin. Paste the following code inside the &lt;ContentPage&gt; definition.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>xmlns:sfPopup=&quot;clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms&quot;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"simple-popup\">Create Simple Popup<\/h3>\n\n\n\n<p>In our first example, there is a button inside the page. When the user clicks the button, a popup opens. This popup is a simple popup that gets user confirmation.<\/p>\n\n\n\n<p>A SfPopup is added to ContentPage as follows. You can add views in StackLayout in SfPopup.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">    &lt;ContentPage.Content&gt;\n        &lt;sfPopup:SfPopupLayout x:Name=&quot;popupLayout&quot;&gt;\n            &lt;sfPopup:SfPopupLayout.Content&gt;\n                &lt;StackLayout x:Name=&quot;mainLayout&quot;&gt;\n                    &lt;Button x:Name=&quot;clickToShowPopup&quot; Text=&quot;ClickToShowPopup&quot; \n               VerticalOptions=&quot;Start&quot; HorizontalOptions=&quot;FillAndExpand&quot;\n                Clicked=&quot;ClickToShowPopup_Clicked&quot;\/&gt;\n                &lt;\/StackLayout&gt;\n            &lt;\/sfPopup:SfPopupLayout.Content&gt;\n        &lt;\/sfPopup:SfPopupLayout&gt;\n    &lt;\/ContentPage.Content&gt;<\/code><\/pre>\n\n\n\n<p>Clicked() method in PopupPage.xaml.cs <\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">public partial class PopupPage : ContentPage\n    {\n    public PopupPage()\n    {\n        InitializeComponent();\n    }\n    private void ClickToShowPopup_Clicked(object sender, EventArgs e)\n    {\n        popupLayout.Show();\n    }\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/09\/popup.gif\" alt=\"Xamarin.Forms Display Popup\" class=\"wp-image-611\" width=\"295\" height=\"640\"\/><figcaption>Xamarin.Forms Display Popup<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"customize-popup\">Customize Popup Layouts<\/h3>\n\n\n\n<p>You can customize the pop-ups according to your wishes. In the example below you will see a screen with a red background with a warning message inside.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">    &lt;sfPopup:SfPopupLayout x:Name=&quot;popupLayout&quot;&gt;\n        &lt;sfPopup:SfPopupLayout.PopupView&gt;\n            &lt;sfPopup:PopupView&gt;\n                &lt;sfPopup:PopupView.ContentTemplate&gt;\n                    &lt;DataTemplate&gt;\n                        &lt;Label Text=&quot;This is a warning&quot; BackgroundColor=&quot;Red&quot; HorizontalTextAlignment=&quot;Center&quot;\/&gt;\n                    &lt;\/DataTemplate&gt;\n                &lt;\/sfPopup:PopupView.ContentTemplate&gt;\n            &lt;\/sfPopup:PopupView&gt;\n        &lt;\/sfPopup:SfPopupLayout.PopupView&gt;\n        &lt;sfPopup:SfPopupLayout.Content&gt;\n            &lt;StackLayout x:Name=&quot;layout&quot;&gt;\n                &lt;Button x:Name=&quot;clickToShowPopup&quot; Text=&quot;ClickToShowPopup&quot; VerticalOptions=&quot;Start&quot; \n               HorizontalOptions=&quot;FillAndExpand&quot;  Clicked=&quot;ClickToShowPopup_Clicked&quot; \/&gt;\n            &lt;\/StackLayout&gt;\n        &lt;\/sfPopup:SfPopupLayout.Content&gt;\n    &lt;\/sfPopup:SfPopupLayout&gt;<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/09\/custom-popup.gif\" alt=\"Xamarin.Forms Custom Popup Layout\" class=\"wp-image-612\" width=\"295\" height=\"640\"\/><figcaption>Xamarin.Forms Custom Popup Layout<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"full-screen-popup\">Full Screen Popup<\/h3>\n\n\n\n<p>Let&#8217;s say you want the user to fill out a form in the application. You may need this when selling tickets or validating. Here, you can create a full screen popup with SfPopupLayout and quickly get data from the user.<\/p>\n\n\n\n<p>You can create full screen popups as follows. If you want, you can customize in the &lt;DataTemplate&gt;.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">    &lt;sfPopup:SfPopupLayout x:Name=&quot;popupLayout&quot;&gt;\n        &lt;sfPopup:SfPopupLayout.PopupView&gt;\n            &lt;sfPopup:PopupView AppearanceMode=&quot;TwoButton&quot;\n                                           AcceptButtonText=&quot;SAVE&quot;\n                                           DeclineButtonText=&quot;CANCEL&quot;&gt;\n                &lt;sfPopup:PopupView.HeaderTemplate&gt;\n                    &lt;DataTemplate&gt;\n                        &lt;Label Text=&quot;ADD EVENT&quot; VerticalTextAlignment=&quot;Center&quot; HorizontalTextAlignment=&quot;Start&quot; FontAttributes=&quot;Bold&quot;\/&gt;\n                    &lt;\/DataTemplate&gt;\n                &lt;\/sfPopup:PopupView.HeaderTemplate&gt;\n                &lt;sfPopup:PopupView.ContentTemplate&gt;\n                    &lt;DataTemplate&gt;\n                        &lt;Grid BackgroundColor=&quot;White&quot; Padding=&quot;15,20,15,0&quot;&gt;\n                            &lt;Grid.RowDefinitions&gt;\n                                &lt;RowDefinition Height=&quot;100&quot;\/&gt;\n                                &lt;RowDefinition Height=&quot;100&quot;\/&gt;\n                                &lt;RowDefinition Height=&quot;30&quot;\/&gt;\n                                &lt;RowDefinition Height=&quot;50&quot;\/&gt;\n                                &lt;RowDefinition Height=&quot;30&quot;\/&gt;\n                                &lt;RowDefinition Height=&quot;50&quot;\/&gt;\n                                &lt;RowDefinition&gt;\n                                    &lt;RowDefinition.Height&gt;\n                                        &lt;OnPlatform x:TypeArguments=&quot;GridLength&quot; Android=&quot;55&quot; iOS=&quot;55&quot;&gt;\n                                            &lt;On Platform=&quot;UWP&quot; Value=&quot;75&quot;\/&gt;\n                                        &lt;\/OnPlatform&gt;\n                                    &lt;\/RowDefinition.Height&gt;\n                                &lt;\/RowDefinition&gt;\n                            &lt;\/Grid.RowDefinitions&gt;\n\n                            &lt;Grid Grid.Row=&quot;0&quot; BackgroundColor=&quot;#F3F3F9&quot; Margin=&quot;0,15,0,0&quot;&gt;\n                                &lt;textinput:SfTextInputLayout Hint=&quot;Event name&quot; ContainerType=&quot;Outlined&quot; BackgroundColor=&quot;Transparent&quot;&gt;\n                                    &lt;Entry HeightRequest=&quot;75&quot; BackgroundColor=&quot;Transparent&quot;\/&gt;\n                                &lt;\/textinput:SfTextInputLayout&gt;\n                            &lt;\/Grid&gt;\n\n                            &lt;Grid Grid.Row=&quot;1&quot; BackgroundColor=&quot;#F3F3F9&quot; Margin=&quot;0,15,0,0&quot;&gt;\n                                &lt;textinput:SfTextInputLayout Hint=&quot;Location&quot; ContainerType=&quot;Outlined&quot; BackgroundColor=&quot;Transparent&quot;&gt;\n                                    &lt;Entry HeightRequest=&quot;75&quot; BackgroundColor=&quot;Transparent&quot;\/&gt;\n                                &lt;\/textinput:SfTextInputLayout&gt;\n                            &lt;\/Grid&gt;\n\n                            &lt;Label Grid.Row=&quot;2&quot; Text=&quot;From&quot; Margin=&quot;0,10,0,0&quot;\/&gt;\n                            &lt;Grid Grid.Row=&quot;3&quot;&gt;\n                                &lt;Grid.ColumnDefinitions&gt;\n                                    &lt;ColumnDefinition\/&gt;\n                                    &lt;ColumnDefinition\/&gt;\n                                &lt;\/Grid.ColumnDefinitions&gt;\n                                &lt;DatePicker Grid.Column=&quot;0&quot; FontSize=&quot;Small&quot;\/&gt;\n                                &lt;TimePicker Grid.Column=&quot;1&quot; FontSize=&quot;Small&quot;\/&gt;\n                            &lt;\/Grid&gt;\n\n                            &lt;Label Grid.Row=&quot;4&quot; Text=&quot;To&quot; Margin=&quot;0,10,0,0&quot;\/&gt;\n                            &lt;Grid Grid.Row=&quot;5&quot;&gt;\n                                &lt;Grid.ColumnDefinitions&gt;\n                                    &lt;ColumnDefinition\/&gt;\n                                    &lt;ColumnDefinition\/&gt;\n                                &lt;\/Grid.ColumnDefinitions&gt;\n                                &lt;DatePicker Grid.Column=&quot;0&quot; FontSize=&quot;Small&quot;\/&gt;\n                                &lt;TimePicker Grid.Column=&quot;1&quot; FontSize=&quot;Small&quot;\/&gt;\n                            &lt;\/Grid&gt;\n                            &lt;Grid Grid.Row=&quot;6&quot; Margin=&quot;0,35,0,0&quot;&gt;\n                                &lt;Grid.ColumnDefinitions&gt;\n                                    &lt;ColumnDefinition Width=&quot;Auto&quot;\/&gt;\n                                    &lt;ColumnDefinition Width=&quot;Auto&quot;\/&gt;\n                                &lt;\/Grid.ColumnDefinitions&gt;\n                                &lt;Switch Grid.Column=&quot;0&quot;\/&gt;\n                                &lt;Label Grid.Column=&quot;1&quot; Text=&quot;All-day&quot;&gt;\n                                    &lt;Label.Margin&gt;\n                                        &lt;OnPlatform x:TypeArguments=&quot;Thickness&quot;&gt;\n                                            &lt;On Platform=&quot;UWP&quot; Value=&quot;0,10,0,0&quot;\/&gt;\n                                        &lt;\/OnPlatform&gt;\n                                    &lt;\/Label.Margin&gt;\n                                &lt;\/Label&gt;\n                            &lt;\/Grid&gt;\n                        &lt;\/Grid&gt;\n                    &lt;\/DataTemplate&gt;\n                &lt;\/sfPopup:PopupView.ContentTemplate&gt;\n            &lt;\/sfPopup:PopupView&gt;\n        &lt;\/sfPopup:SfPopupLayout.PopupView&gt;\n        &lt;sfPopup:SfPopupLayout.Content&gt;\n            &lt;StackLayout x:Name=&quot;layout&quot;&gt;\n                &lt;Button x:Name=&quot;clickToShowPopup&quot; Text=&quot;ClickToShowPopup&quot; \n               VerticalOptions=&quot;Start&quot;   HorizontalOptions=&quot;FillAndExpand&quot; Clicked=&quot;ClickToShowPopup_Clicked&quot; \/&gt;\n            &lt;\/StackLayout&gt;\n        &lt;\/sfPopup:SfPopupLayout.Content&gt;\n    &lt;\/sfPopup:SfPopupLayout&gt;<\/code><\/pre>\n\n\n\n<p>Clicked method in PopupPage.xaml.cs<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">public partial class PopupPage : ContentPage\n{\n    public PopupPage()\n    {\n        InitializeComponent();\n    }\n    private void ClickToShowPopup_Clicked(object sender, EventArgs e)\n    {\n        popupLayout.PopupView.IsFullScreen = true;\n        popupLayout.IsOpen = true;\n    }\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/09\/full-screen-popup.gif\" alt=\"Xamarin.Forms Full Screen Popup\" class=\"wp-image-613\" width=\"295\" height=\"640\"\/><figcaption>Xamarin.Forms Full Screen Popup<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"popup-animations\">Popup Animations<\/h3>\n\n\n\n<p>The SfPopupLayout plugin provides animations that you can apply when opening or closing popups. These animations are: <strong>Zoom, Fade, SlideOnLeft, SlideOnRight, SlideOnTop, SlideOnBottom, None<\/strong>. You can animate in popups simply by setting AnimationMode.<\/p>\n\n\n\n<p>PopupPage.xaml<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">    &lt;sfPopup:SfPopupLayout x:Name=&quot;popupLayout&quot;&gt;\n        &lt;sfPopup:SfPopupLayout.PopupView&gt;\n            &lt;sfPopup:PopupView AnimationMode=&quot;SlideOnLeft&quot; \/&gt;\n        &lt;\/sfPopup:SfPopupLayout.PopupView&gt;\n        &lt;sfPopup:SfPopupLayout.Content&gt;\n            &lt;StackLayout x:Name=&quot;layout&quot;&gt;\n                &lt;Button x:Name=&quot;clickToShowPopup&quot; Text=&quot;ClickToShowPopup&quot; \n               VerticalOptions=&quot;Start&quot;   HorizontalOptions=&quot;FillAndExpand&quot; Clicked=&quot;ClickToShowPopup_Clicked&quot; \/&gt;\n            &lt;\/StackLayout&gt;\n        &lt;\/sfPopup:SfPopupLayout.Content&gt;\n    &lt;\/sfPopup:SfPopupLayout&gt;<\/code><\/pre>\n\n\n\n<p>PopupPage.xaml.cs<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">public partial class PopupPage : ContentPage\n{\n    public PopupPage()\n    {\n        InitializeComponent();\n    }\n    private void ClickToShowPopup_Clicked(object sender, EventArgs e)\n    {\n        popupLayout.Show();\n    }\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/09\/animation-popup.gif\" alt=\"Xamarin.Forms Popup Animation\" class=\"wp-image-610\" width=\"295\" height=\"640\"\/><figcaption>Xamarin.Forms Popup Animation<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Popups are very important for the usability of a mobile application. You may need to ask the user to confirm or reject a selection when necessary. Or you can ask the user to quickly fill out a form. These are factors that improve the user experience of a mobile application.<\/p>\n\n\n\n<p>It is possible to do all this with the SfPopupLayout plugin. With SfPopupLayout, you can create and customize different types of popups. You can even enable these popups to open and close animations.<\/p>\n\n\n\n<p>In this post, I explained how to use the SfPopupLayout plugin in a Xamarin.Forms project. I hope it was useful.<\/p>\n\n\n\n<p>If you\u2019re still not sure what to do, or if you got any errors, then I suggest you use the comment section below and let me know! I am here to help!<\/p>\n\n\n\n<p><strong>Also, share this blog post on social media and help more people learn.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Links<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/serkanseker.com\/best-nuget-packages\/\" target=\"_blank\" rel=\"noreferrer noopener\">Best NuGet Packages<\/a><\/li><li><a href=\"https:\/\/serkanseker.com\/syncfusion-community-license-key\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Register For Syncfusion and Get License<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/serkanseker.com\/xamarin-forms-listview-grouping\/\" target=\"_blank\">Xamarin.Forms ListView Grouping<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/serkanseker.com\/xamarin-forms-visualize-your-data-with-sfchart\/\" target=\"_blank\">Visualize Your Data With SfChart in Xamarin.Forms<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/serkanseker.com\/xamarin-forms-progressbar-example\/\" target=\"_blank\">Xamarin.Forms ProgressBar Example<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We all know popups. We use popups when the user needs to confirm or reject a selection. Or sometimes we display it in the middle of the screen to show warning messages. Thus, we aim to increase the user experience of the mobile application. So popups are very important for a mobile application.<\/p>\n","protected":false},"author":1,"featured_media":217,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[572,21,39],"tags":[570,43,28,4,5],"class_list":["post-558","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nuget","category-xamarin","category-xamarin-forms","tag-nuget","tag-popup","tag-syncfusion","tag-xamarin","tag-xamarin-forms"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Display Popup Message in Xamarin.Forms - Serkan Seker TR<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Display Popup Message in Xamarin.Forms - Serkan Seker TR\" \/>\n<meta property=\"og:description\" content=\"We all know popups. We use popups when the user needs to confirm or reject a selection. Or sometimes we display it in the middle of the screen to show warning messages. Thus, we aim to increase the user experience of the mobile application. So popups are very important for a mobile application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/\" \/>\n<meta property=\"og:site_name\" content=\"Serkan Seker TR\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-03T09:42:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-23T07:14:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1\" \/>\n\t<meta property=\"og:image:height\" content=\"1\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"serkanadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"serkanadmin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/\"},\"author\":{\"name\":\"serkanadmin\",\"@id\":\"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5\"},\"headline\":\"How To Display Popup Message in Xamarin.Forms\",\"datePublished\":\"2020-09-03T09:42:39+00:00\",\"dateModified\":\"2021-02-23T07:14:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/\"},\"wordCount\":960,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg\",\"keywords\":[\"NuGet\",\"popup\",\"syncfusion\",\"xamarin\",\"xamarin.forms\"],\"articleSection\":[\"NuGet\",\"Xamarin\",\"Xamarin.Forms\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/\",\"url\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/\",\"name\":\"How To Display Popup Message in Xamarin.Forms - Serkan Seker TR\",\"isPartOf\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg\",\"datePublished\":\"2020-09-03T09:42:39+00:00\",\"dateModified\":\"2021-02-23T07:14:44+00:00\",\"author\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5\"},\"breadcrumb\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#primaryimage\",\"url\":\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg\",\"contentUrl\":\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/serkanseker.com\/tr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Display Popup Message in Xamarin.Forms\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/serkanseker.com\/tr\/#website\",\"url\":\"https:\/\/serkanseker.com\/tr\/\",\"name\":\"Serkan Seker TR\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/serkanseker.com\/tr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5\",\"name\":\"serkanadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/93ddc1f96117bf468976afe93a077eda77de96bcdb48dc749903598a546786a3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/93ddc1f96117bf468976afe93a077eda77de96bcdb48dc749903598a546786a3?s=96&d=mm&r=g\",\"caption\":\"serkanadmin\"},\"sameAs\":[\"https:\/\/serkanseker.com\"],\"url\":\"https:\/\/serkanseker.com\/tr\/author\/serkanadmin\/\"},{\"@type\":\"HowTo\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#howto-1\",\"name\":\"How To Display Popup Message in Xamarin.Forms\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#article\"},\"description\":\"\",\"step\":[{\"@type\":\"HowToStep\",\"url\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#how-to-step-1614012713115\",\"text\":\"Install Syncfusion.Xamarin.SfPopupLayout Plugin\"},{\"@type\":\"HowToStep\",\"url\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#how-to-step-1614012731464\",\"text\":\"Launch the SfPopupLayout on Each Platform\"},{\"@type\":\"HowToStep\",\"url\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#how-to-step-1614012770101\",\"name\":\"Consume SfPopupLayout in XAML\",\"itemListElement\":[{\"@type\":\"HowToDirection\",\"text\":\"<a href=\\\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#simple-popup\\\">1<\/a>)<a href=\\\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#simple-popup\\\">Create Simple Popup<br\/><\/a><a href=\\\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#customize-popup\\\">2<\/a>)<a href=\\\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#customize-popup\\\">Customize Popup Layouts<br\/><\/a><a href=\\\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#popup-animations\\\">3<\/a>)<a href=\\\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#popup-animations\\\">Popup Animations<br\/><\/a><a href=\\\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#full-screen-popup\\\">4<\/a>)<a href=\\\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#full-screen-popup\\\">Full Screen Popup<\/a>\"}]},{\"@type\":\"HowToStep\",\"url\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#how-to-step-1614012928482\",\"text\":\"Conclusion\"}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Display Popup Message in Xamarin.Forms - Serkan Seker TR","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"How To Display Popup Message in Xamarin.Forms - Serkan Seker TR","og_description":"We all know popups. We use popups when the user needs to confirm or reject a selection. Or sometimes we display it in the middle of the screen to show warning messages. Thus, we aim to increase the user experience of the mobile application. So popups are very important for a mobile application.","og_url":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/","og_site_name":"Serkan Seker TR","article_published_time":"2020-09-03T09:42:39+00:00","article_modified_time":"2021-02-23T07:14:44+00:00","og_image":[{"url":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg","width":1,"height":1,"type":"image\/jpeg"}],"author":"serkanadmin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"serkanadmin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#article","isPartOf":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/"},"author":{"name":"serkanadmin","@id":"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5"},"headline":"How To Display Popup Message in Xamarin.Forms","datePublished":"2020-09-03T09:42:39+00:00","dateModified":"2021-02-23T07:14:44+00:00","mainEntityOfPage":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/"},"wordCount":960,"commentCount":0,"image":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#primaryimage"},"thumbnailUrl":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg","keywords":["NuGet","popup","syncfusion","xamarin","xamarin.forms"],"articleSection":["NuGet","Xamarin","Xamarin.Forms"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/","url":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/","name":"How To Display Popup Message in Xamarin.Forms - Serkan Seker TR","isPartOf":{"@id":"https:\/\/serkanseker.com\/tr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#primaryimage"},"image":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#primaryimage"},"thumbnailUrl":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg","datePublished":"2020-09-03T09:42:39+00:00","dateModified":"2021-02-23T07:14:44+00:00","author":{"@id":"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5"},"breadcrumb":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#primaryimage","url":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg","contentUrl":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Popup.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/serkanseker.com\/tr\/"},{"@type":"ListItem","position":2,"name":"How To Display Popup Message in Xamarin.Forms"}]},{"@type":"WebSite","@id":"https:\/\/serkanseker.com\/tr\/#website","url":"https:\/\/serkanseker.com\/tr\/","name":"Serkan Seker TR","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/serkanseker.com\/tr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5","name":"serkanadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/93ddc1f96117bf468976afe93a077eda77de96bcdb48dc749903598a546786a3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93ddc1f96117bf468976afe93a077eda77de96bcdb48dc749903598a546786a3?s=96&d=mm&r=g","caption":"serkanadmin"},"sameAs":["https:\/\/serkanseker.com"],"url":"https:\/\/serkanseker.com\/tr\/author\/serkanadmin\/"},{"@type":"HowTo","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#howto-1","name":"How To Display Popup Message in Xamarin.Forms","mainEntityOfPage":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#article"},"description":"","step":[{"@type":"HowToStep","url":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#how-to-step-1614012713115","text":"Install Syncfusion.Xamarin.SfPopupLayout Plugin"},{"@type":"HowToStep","url":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#how-to-step-1614012731464","text":"Launch the SfPopupLayout on Each Platform"},{"@type":"HowToStep","url":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#how-to-step-1614012770101","name":"Consume SfPopupLayout in XAML","itemListElement":[{"@type":"HowToDirection","text":"<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#simple-popup\">1<\/a>)<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#simple-popup\">Create Simple Popup<br\/><\/a><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#customize-popup\">2<\/a>)<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#customize-popup\">Customize Popup Layouts<br\/><\/a><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#popup-animations\">3<\/a>)<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#popup-animations\">Popup Animations<br\/><\/a><a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#full-screen-popup\">4<\/a>)<a href=\"https:\/\/serkanseker.com\/xamarin-forms-popup\/#full-screen-popup\">Full Screen Popup<\/a>"}]},{"@type":"HowToStep","url":"https:\/\/serkanseker.com\/tr\/xamarin-forms-popup\/#how-to-step-1614012928482","text":"Conclusion"}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/posts\/558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/comments?post=558"}],"version-history":[{"count":0,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/posts\/558\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/media\/217"}],"wp:attachment":[{"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/media?parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/categories?post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/tags?post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}