Add more then one popup to the page

I haven't seen any example with more then one popup in the page is it possible?

My purpose is to show a pop up nad then after this is closed show another one.

Alberto C.

1 Reply

SR Sivakumar R Syncfusion Team July 19, 2018 05:17 AM UTC

  
Hi Alberto, 
 
Thanks for contacting Syncfusion Support. 
 
We would consider your feedback about our help documentation. You can not display more than one popup at the same time in a page. We have prepared a sample to achieve your requirement a popup will be opened and when it is closed, another popup will be opened. Please find the code snippet of the same below: 
 
// MainPage.xaml 
 
<ContentPage.BindingContext> 
    <local:ViewModel /> 
</ContentPage.BindingContext> 
 
<ContentPage.Content> 
    <StackLayout> 
        <Button x:Name="isOpenButton" Text="Click to open popup" Command="{Binding OpenPopupCommand}"/> 
    </StackLayout> 
</ContentPage.Content> 
 
//ViewModel.cs 
 
public class ViewModel 
{ 
    private SfPopupLayout popupLayout1; 
    private SfPopupLayout popupLayout2; 
    private DataTemplate templateView; 
 
    public ICommand OpenPopupCommand { get; set; } 
 
    public ViewModel() 
    { 
        OpenPopupCommand = new Command(OpenPopup); 
        popupLayout1 = new SfPopupLayout(); 
        popupLayout1.PopupView.AnimationMode = AnimationMode.None; 
        popupLayout2 = new SfPopupLayout(); 
        templateView = new DataTemplate(() => 
        { 
            Button popupContent = new Button(); 
            popupContent.Text = "Click to open another popup"; 
            popupContent.Clicked += (s, e) => 
            { 
                popupLayout1.Dismiss(); 
                popupLayout2.Show(); 
            }; 
            return popupContent; 
        }); 
        popupLayout1.PopupView.ContentTemplate = templateView;             
    } 
 
    private void OpenPopup() 
    { 
        popupLayout1.Show(); 
    } 
} 
 
 
Thanks, 
Sivakumar 


Loader.
Up arrow icon