We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Show Popup without clicking a button

Thread ID:





143076 Mar 4,2019 09:35 AM UTC Mar 5,2019 11:25 AM UTC Xamarin.Forms 2
Tags: SfPopup
Asked On March 4, 2019 09:35 AM UTC

i have this code 
 ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             x:Class="WGBSync.Views.Register" BackgroundImage="bg.png" NavigationPage.HasBackButton="False" NavigationPage.HasNavigationBar="False">
    <sfPopup:SfPopupLayout x:Name="popupme" >
            <OnPlatform x:TypeArguments="Thickness">
                <On Platform="iOS" Value="0, 20, 0, 0" />
            <StackLayout x:Name="mainLayout">
   </sfPopup:SfPopupLayout >

and this c# code
     public  void popup(string message, int type, string header)

                   contentTemplateView = new DataTemplate(() =>
                        popupContent = new Label
                            Text = message,
                            TextColor = type == 1 ? Color.Green : Color.Red,
                            BackgroundColor = Color.White,
                            HorizontalTextAlignment = TextAlignment.Center,
                        return popupContent;
                     headerTemplateView = new DataTemplate(() =>
                        popupheader = new Label
                            Text = header,
                            FontAttributes = FontAttributes.Bold,
                            BackgroundColor = type == 1 ? Color.Green : Color.Red,
                            FontSize = 16,
                            TextColor = Color.White,
                            HorizontalTextAlignment = TextAlignment.Center,
                            VerticalTextAlignment = TextAlignment.Center
                        return popupheader;
                    popupme.PopupView.HeaderTemplate = headerTemplateView;
                    popupme.PopupView.ContentTemplate = contentTemplateView;
                    popupme.PopupView.AppearanceMode = AppearanceMode.OneButton;
                    popupme.PopupView.AnimationMode = AnimationMode.Zoom;
                    popupme.PopupView.AcceptButtonText = "OK";

            catch(Exception ex)
 i want to call popup like this on registration success popup("Registration Successful",1,"Sucess") on the click of register button.
am getting noSuchmethodError

Replied On March 4, 2019 01:02 PM UTC

please help

Subburaj Pandian Veluchamy [Syncfusion]
Replied On March 5, 2019 11:25 AM UTC

Hi Temitope, 
Thank you for contacting Syncfusion support. 
Based on the provided information, your requirement of “Showing Popup layout as a content in the page without any click operation” can be achieved by setting the Popup layout as content in the concern page. And if your requirement is to render the Popup without any function like Button click, you can call Show method in the Popup with the delay.  
Please refer the following code example, 
private async void showpopup() 
            await Task.Delay(1000); 

We have prepared sample by setting Popup as content in the ContentPage and shown the Popup directly without any click operation. Please find the sample by the following link, 
We hope this helps. Please let us know, if you have any query. 
Subburaj Pandian V 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon