menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PopupView - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PopupView

    Defines the pop-up view of SfPopupLayout.

    Inheritance
    System.Object
    PopupView
    Implements
    System.IDisposable
    Namespace: Syncfusion.XForms.PopupLayout
    Assembly: Syncfusion.SfPopupLayout.XForms.dll
    Syntax
    public class PopupView : View, IDisposable

    Constructors

    PopupView()

    Initializes a new instance of the PopupView class.

    Declaration
    public PopupView()

    Fields

    AcceptButtonTextProperty

    Identifies the AcceptButtonText bindable property.

    Declaration
    public static readonly BindableProperty AcceptButtonTextProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    AcceptCommandProperty

    Identifies the AcceptCommand bindable property.

    Declaration
    public static readonly BindableProperty AcceptCommandProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    AnimationDurationProperty

    Identifies the AnimationDuration bindable property.

    Declaration
    public static readonly BindableProperty AnimationDurationProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    AnimationEasingProperty

    Identifies the AnimationEasing bindable property.

    Declaration
    public static readonly BindableProperty AnimationEasingProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    AnimationModeProperty

    Identifies the AnimationMode bindable property.

    Declaration
    public static readonly BindableProperty AnimationModeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    AppearanceModeProperty

    Identifies the AppearanceMode bindable property.

    Declaration
    public static readonly BindableProperty AppearanceModeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    AutoSizeModeProperty

    Identifies the AutoSizeMode bindable property.

    Declaration
    public static readonly BindableProperty AutoSizeModeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ContentTemplateProperty

    Identifies the ContentTemplate bindable property.

    Declaration
    public static readonly BindableProperty ContentTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    DeclineButtonTextProperty

    Identifies the DeclineButtonText bindable property.

    Declaration
    public static readonly BindableProperty DeclineButtonTextProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    DeclineCommandProperty

    Identifies the DeclineCommand bindable property.

    Declaration
    public static readonly BindableProperty DeclineCommandProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    FooterHeightProperty

    Identifies the FooterHeight bindable property.

    Declaration
    public static readonly BindableProperty FooterHeightProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    FooterTemplateProperty

    Identifies the FooterTemplate bindable property.

    Declaration
    public static readonly BindableProperty FooterTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    HeaderHeightProperty

    Identifies the HeaderHeight bindable property.

    Declaration
    public static readonly BindableProperty HeaderHeightProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    HeaderTemplateProperty

    Identifies the HeaderTemplate bindable property.

    Declaration
    public static readonly BindableProperty HeaderTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    HeaderTitleProperty

    Identifies the HeaderTitle bindable property.

    Declaration
    public static readonly BindableProperty HeaderTitleProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    IsFullScreenProperty

    Identifies the IsFullScreen bindable property.

    Declaration
    public static readonly BindableProperty IsFullScreenProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    PopupStyleProperty

    Identifies the PopupStyle bindable property.

    Declaration
    public static readonly BindableProperty PopupStyleProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ShowCloseButtonProperty

    Identifies the ShowCloseButton bindable property.

    Declaration
    public static readonly BindableProperty ShowCloseButtonProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ShowFooterProperty

    Identifies the ShowFooter bindable property.

    Declaration
    public static readonly BindableProperty ShowFooterProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ShowHeaderProperty

    Identifies the ShowHeader bindable property.

    Declaration
    public static readonly BindableProperty ShowHeaderProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    StartXProperty

    Identifies the StartX bindable property.

    Declaration
    public static readonly BindableProperty StartXProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    StartYProperty

    Identifies the StartY bindable property.

    Declaration
    public static readonly BindableProperty StartYProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    Properties

    AcceptButtonText

    Gets or sets the text of accept button in the footer.

    Declaration
    public string AcceptButtonText { get; set; }
    Property Value
    Type Description
    System.String

    The text of the accept button in the footer.

    Examples

    The following code example demonstrates how to set text for the accept button in PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AcceptButtonText = "Done"; popupLayout.PopupView.AppearanceMode = AppearanceMode.OneButton; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView  AppearanceMode="OneButton" AcceptButtonText="Done" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    AcceptCommand

    Gets or sets the command to invoke when the accept button in the footer is tapped.

    Declaration
    public ICommand AcceptCommand { get; set; }
    Property Value
    Type
    System.Windows.Input.ICommand
    Examples

    The following code example demonstrates how to set command for the accept button in PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using System.Windows.Input;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; PopupViewModel viewModel; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); viewModel = new PopupViewModel(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AppearanceMode = AppearanceMode.TwoButton; popupLayout.PopupView.AcceptCommand = viewModel.AcceptCommand; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }
    // ViewModel.cs
    using System.ComponentModel; using System.Windows.Input; using Xamarin.Forms;

    namespace Popup { class PopupViewModel : INotifyPropertyChanged { bool open; public event PropertyChangedEventHandler PropertyChanged; void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public AcceptButtonCustomCommand AcceptCommand { get; set; }
    public ICommand PopupCommand { get; set; } public bool PopupOpen { get { return open; } set { open = value; OnPropertyChanged(nameof(PopupOpen)); } } public PopupViewModel() { AcceptCommand = new AcceptButtonCustomCommand();
    PopupCommand = new Command(PopupShow); } private void PopupShow() { PopupOpen = true; }
    }
    public class AcceptButtonCustomCommand : ICommand { public event EventHandler CanExecuteChanged; public bool CanExecute(object parameter) { return false; } public void Execute(object parameter) { } } }
    <code lang="XAML"> <![CDATA[ <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:Popup" xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms" x:Class="Popup.MainPage"> <ContentPage.BindingContext> <local:PopupViewModel x:Name="view"/> </ContentPage.BindingContext> <sfPopup:SfPopupLayout IsOpen="{Binding PopupOpen}" StaysOpen="True"> <sfPopup:SfPopupLayout.PopupView> <sfPopup:PopupView AppearanceMode="TwoButton"
    AcceptCommand="{Binding AcceptCommand}"
    AcceptButtonText="Ok" DeclineButtonText="Cancel"> </sfPopup:PopupView> </sfPopup:SfPopupLayout.PopupView> <sfPopup:SfPopupLayout.Content> <StackLayout> <Button Text="ClickToShowPopup" VerticalOptions="CenterAndExpand" HorizontalOptions="Center" Command="{Binding PopupCommand}" /> </StackLayout> </sfPopup:SfPopupLayout.Content> </sfPopup:SfPopupLayout> </ContentPage>

    AnimationDuration

    Gets or sets the duration in milliseconds of the animation played when opening and closing the PopupView.

    Declaration
    public double AnimationDuration { get; set; }
    Property Value
    Type Description
    System.Double

    The duration in milliseconds of the animation played at the opening and closing of the PopupView.

    Examples

    The following code example demonstrates how to set animation duration for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AnimationDuration = 1000; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView  AnimationDuration="1000" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    AnimationEasing

    Gets or sets the animation easing effect to be applied to the PopupView's opening and closing animation.

    Declaration
    public AnimationEasing AnimationEasing { get; set; }
    Property Value
    Type Description
    AnimationEasing

    The animation easing effect to be applied for the PopupView when it opens and closes.

    Examples

    The following code example demonstrates how to set animation easing effect for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AnimationEasing = AnimationEasing.SinOut; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView  AnimationEasing="SinOut" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    AnimationMode

    Gets or sets the animation to be applied for the PopupView when opening and closing it.

    Declaration
    public AnimationMode AnimationMode { get; set; }
    Property Value
    Type Description
    AnimationMode

    The animation to be applied for the PopupView when it opens and closes.

    Examples

    The following code example demonstrates how to set animation mode for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AnimationMode = AnimationMode.Fade; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView  AnimationMode="Fade" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    AppearanceMode

    Gets or sets the type of layout template of the PopupView.

    Declaration
    public AppearanceMode AppearanceMode { get; set; }
    Property Value
    Type Description
    AppearanceMode

    The type of layout template of the PopupView.

    Examples

    The following code example demonstrates how to set appearance mode for the footer in PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace GettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AppearanceMode = AppearanceMode.OneButton; }

        private void ClickToShowPopup_Clicked(object sender, EventArgs e)
        {
            popupLayout.Show();
        }
    }
    

    }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:GettingStarted"
                 x:Class="GettingStarted.MainPage" 
                 Padding="0,40,0,0"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView AppearanceMode="OneButton" />
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked += ClickToShowPopup_Clicked/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    AutoSizeMode

    Gets or sets a value that determines how to size the PopupView based on its template contents.

    Declaration
    public AutoSizeMode AutoSizeMode { get; set; }
    Property Value
    Type Description
    AutoSizeMode

    The AutoSizeMode that is applied to the PopupView. The default value is AutoSizeMode.

    Examples

    The following code example demonstrates how to set size for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AutoSizeMode = AutoSizeMode.Both; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView AutoSizeMode="Both">
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    ContentTemplate

    Gets or sets the template to be loaded in the body of the PopupView.

    Declaration
    public DataTemplate ContentTemplate { get; set; }
    Property Value
    Type Description
    Xamarin.Forms.DataTemplate

    The template to be loaded in the body of the PopupView.

    Examples

    The following code example demonstrates how to set Content template for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace GettingStarted { public partial class MainPage : ContentPage { DataTemplate templateView; Label popupContent; SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; templateView = new DataTemplate(() => { popupContent = new Label(); popupContent.Text = "This is the SfPopupLayout"; popupContent.BackgroundColor = Color.LightSkyBlue; popupContent.HorizontalTextAlignment = TextAlignment.Center; return popupContent; });
    popupLayout.PopupView.ContentTemplate = templateView; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:GettingStarted"
                 x:Class="GettingStarted.MainPage" 
                 Padding="0,40,0,0"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView>
                    <sfPopup:PopupView.ContentTemplate>
                        <DataTemplate>
                            <Label Text = "This is SfPopupLayout" BackgroundColor="SkyBlue"
                                   HorizontalTextAlignment="Center"/>
                        </DataTemplate>
                    </sfPopup:PopupView.ContentTemplate>
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" 
                            HorizontalOptions="FillAndExpand"  Clicked="ClickToShowPopup_Clicked" />
                </StackLayout>
                <sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    DeclineButtonText

    Gets or sets the text of decline button in the footer.

    Declaration
    public string DeclineButtonText { get; set; }
    Property Value
    Type Description
    System.String

    The text of the decline button in the footer.

    Examples

    The following code example demonstrates how to set text for the decline button in PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.DeclineButtonText = "Reject"; popupLayout.PopupView.AppearanceMode = AppearanceMode.OneButton; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView  AppearanceMode="OneButton" DeclineButtonText="Reject" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    DeclineCommand

    Gets or sets the command to invoke when the decline button in the footer is tapped.

    Declaration
    public ICommand DeclineCommand { get; set; }
    Property Value
    Type
    System.Windows.Input.ICommand
    Examples

    The following code example demonstrates how to set command for the decline button in PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using System.Windows.Input;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; PopupViewModel viewModel; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); viewModel = new PopupViewModel(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AppearanceMode = AppearanceMode.TwoButton; popupLayout.PopupView.DeclineCommand = viewModel.DeclineCommand; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } } // ViewModel.cs
    using System.ComponentModel; using System.Windows.Input; using Xamarin.Forms;

    namespace Popup { class PopupViewModel : INotifyPropertyChanged { bool open; public event PropertyChangedEventHandler PropertyChanged; void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); }

        public DeclineButtonCustomCommand DeclineCommand { get; set; }
        public ICommand PopupCommand { get; set; }
        public bool PopupOpen
        {
            get { return open; }
            set
            {
                open = value;
                OnPropertyChanged(nameof(PopupOpen));
            }
        }
        public PopupViewModel()
        {
            DeclineCommand = new DeclineButtonCustomCommand();
            PopupCommand = new Command(PopupShow);
        }
        private void PopupShow()
        {
            PopupOpen = true;
        }    
    }
    public class DeclineButtonCustomCommand : ICommand
    {
        public event EventHandler CanExecuteChanged;
        public bool CanExecute(object parameter)
        {
            return true;
        }
        public void Execute(object parameter)
        {
        }
    }
    

    } <code lang="XAML"> <![CDATA[ <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:Popup" xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms" x:Class="Popup.MainPage"> <ContentPage.BindingContext> <local:PopupViewModel x:Name="view"/> </ContentPage.BindingContext> <sfPopup:SfPopupLayout IsOpen="{Binding PopupOpen}" StaysOpen="True"> <sfPopup:SfPopupLayout.PopupView> <sfPopup:PopupView AppearanceMode="TwoButton"
    DeclineCommand="{Binding DeclineCommand}"
    AcceptButtonText="Ok" DeclineButtonText="Cancel"> </sfPopup:PopupView> </sfPopup:SfPopupLayout.PopupView> <sfPopup:SfPopupLayout.Content> <StackLayout> <Button Text="ClickToShowPopup" VerticalOptions="CenterAndExpand" HorizontalOptions="Center" Command="{Binding PopupCommand}" /> </StackLayout> </sfPopup:SfPopupLayout.Content> </sfPopup:SfPopupLayout> </ContentPage>

    FooterHeight

    Gets or sets the footer height of the PopupView.

    Declaration
    public int FooterHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    The footer height of the PopupView.

    Examples

    The following code example demonstrates how to set footer height for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.FooterHeight = 20; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView FooterHeight="20" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    FooterTemplate

    Gets or sets the template to be loaded in the footer of the PopupView.

    Declaration
    public DataTemplate FooterTemplate { get; set; }
    Property Value
    Type Description
    Xamarin.Forms.DataTemplate

    The template to be loaded in the footer of the PopupView.

    Examples

    The following code example demonstrates how to set footer template for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace GettingStarted { public partial class MainPage : ContentPage { DataTemplate footerTemplateView; Label footerContent; SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; footerTemplateView = new DataTemplate(() => { footerContent = new Label(); footerContent.Text = "Customized Footer"; footerContent.FontAttributes = FontAttributes.Bold; footerContent.BackgroundColor = Color.FromRgb(0, 0, 225); footerContent.FontSize = 16; footerContent.HorizontalTextAlignment = TextAlignment.Center; footerContent.VerticalTextAlignment = TextAlignment.Center; return footerContent; });
    popupLayout.PopupView.FooterTemplate = footerTemplateView; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:GettingStarted"
                 x:Class="GettingStarted.MainPage" 
                 Padding="0,40,0,0"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView>
                    <sfPopup:PopupView.FooterTemplate>
                        <DataTemplate>
                            <Label Text = "Customized Footer"
                                   FontAttributes="Bold"
                                   BackgroundColor="Blue"
                                   FontSize="16"
                                   HorizontalTextAlignment="Center"
                                   VerticalTextAlignment="Center"/>
                        </DataTemplate>
                    </sfPopup:PopupView.FooterTemplate>
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked=" ClickToShowPopup_Clicked" />
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    HeaderHeight

    Gets or sets the header height of the PopupView.

    Declaration
    public int HeaderHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    The header height of the PopupView.

    Examples

    The following code example demonstrates how to set header height for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.HeaderHeight = 20; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView HeaderHeight="20" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    HeaderTemplate

    Gets or sets the template to be loaded in the header of the PopupView.

    Declaration
    public DataTemplate HeaderTemplate { get; set; }
    Property Value
    Type Description
    Xamarin.Forms.DataTemplate

    The template to be loaded in the header of the PopupView.

    Examples

    The following code example demonstrates how to set header template for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { DataTemplate headerTemplateView; Label headerContent; SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; headerTemplateView = new DataTemplate(() => { headerContent = new Label(); headerContent.Text = "Customized Header"; headerContent.FontAttributes = FontAttributes.Bold; headerContent.BackgroundColor = Color.FromRgb(0, 0, 225); headerContent.FontSize = 16; headerContent.HorizontalTextAlignment = TextAlignment.Center; headerContent.VerticalTextAlignment = TextAlignment.Center; return headerContent; });
    popupLayout.PopupView.HeaderTemplate = headerTemplateView; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView >
                    <sfPopup:PopupView.HeaderTemplate>
                        <DataTemplate>
                            <Label Text = "Customized Header"
                                   FontAttributes="Bold"
                                   BackgroundColor="Blue"
                                   FontSize="16"
                                   HorizontalTextAlignment="Center"
                                   VerticalTextAlignment="Center"/>
                        </DataTemplate>
                    </sfPopup:PopupView.HeaderTemplate>
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage> 

    HeaderTitle

    Gets or sets the header title of the PopupView.

    Declaration
    public string HeaderTitle { get; set; }
    Property Value
    Type Description
    System.String

    The Header title of the PopupView.

    Examples

    The following code example demonstrates how to set text for the header title in PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.HeaderTitle = "Login"; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView HeaderTitle="Login" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    IsFullScreen

    Gets or sets a value indicating whether to show the Popupview in full screen or not.

    Declaration
    public bool IsFullScreen { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value indicating whether to show the Popupview in full screen.

    Remarks

    If SfPopupLayout.PopupView.IsFullScreen is set as true, the height request and width request given for the PopupView will not be considered.

    Examples

    The following code example demonstrates how to set full scrren for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup);w Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.IsFullScreen = true; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.IsOpen=true; } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView  IsFullScreen="True" IsOpen="True">
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    PopupStyle

    Gets or sets the style to be applied to the PopupView in SfPopupLayout.

    Declaration
    public PopupStyle PopupStyle { get; set; }
    Property Value
    Type Description
    PopupStyle

    The style to be applied to the PopupView in SfPopupLayout.

    Examples

    The following code example demonstrates how to set style for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; PopupStyle myPopupStyle; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); myPopupStyle = new PopupStyle(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.AnimationMode = AnimationMode.Fade; myPopupStyle.HeaderBackgroundColor = Color.FromRgb(105, 105, 105); myPopupStyle.HeaderFontAttribute = FontAttributes.Bold; myPopupStyle.HeaderFontFamily = "Helvetica-Bold"; myPopupStyle.HeaderFontSize = 25; myPopupStyle.HeaderTextAlignment = TextAlignment.Center; myPopupStyle.HeaderTextColor = Color.White; popupLayout.PopupView.PopupStyle = myPopupStyle; } } }

    <<?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
            <sfPopup:SfPopupLayout x:Name="popupLayout">
                <sfPopup:SfPopupLayout.PopupView>
                    <sfPopup:PopupView>
                        <sfPopup:PopupView.PopupStyle>
                            <sfPopup:PopupStyle HeaderBackgroundColor = "DimGray"
                                                HeaderFontAttribute="Bold"
                                                HeaderFontFamily="Helvetica-Bold"
                                                HeaderFontSize="25"
                                                HeaderTextAlignment="Center"
                                                HeaderTextColor="White">
                            </sfPopup:PopupStyle>
                        </sfPopup:PopupView.PopupStyle>
                    </sfPopup:PopupView>
                </sfPopup:SfPopupLayout.PopupView>
            </sfPopup:SfPopupLayout>
     </ContentPage>

    ShowCloseButton

    Gets or sets a value indicating whether to show the close button in the header.

    Declaration
    public bool ShowCloseButton { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value indicating whether to show the close button in the header.

    Examples

    The following code example demonstrates how to set Close button for the header in PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.ShowCloseButton = false; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView ShowCloseButton = "False" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    ShowFooter

    Gets or sets a value indicating whether the footer is to be included in the PopupView.

    Declaration
    public bool ShowFooter { get; set; }
    Property Value
    Type Description
    System.Boolean

    A value indicating whether the footer is to be included in the PopupView.

    Examples

    The following code example demonstrates how to set footer for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.ShowFooter = false; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView ShowFooter = "False" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    ShowHeader

    Gets or sets a value indicating whether the header is to be included in the PopupView.

    Declaration
    public bool ShowHeader { get; set; }
    Property Value
    Type Description
    System.Boolean

    A value indicating whether the header is to be included in the PopupView.

    Examples

    The following code example demonstrates how to set header for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.ShowHeader = false; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView ShowHeader= "False" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    StartX

    Gets or sets the x-position of the PopupView.

    Declaration
    public int StartX { get; set; }
    Property Value
    Type Description
    System.Int32

    The x-position of the PopupView.

    Examples

    The following code example demonstrates how to set X-position for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.StartX = 20; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView StartX="50">
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    StartY

    Gets or sets the y-position of the PopupView.

    Declaration
    public int StartY { get; set; }
    Property Value
    Type Description
    System.Int32

    The y-position of the PopupView.

    Examples

    The following code example demonstrates how to set Y-position for the PopupView.

    using Syncfusion.XForms.PopupLayout;
    using System;
    using Xamarin.Forms;
    

    namespace SfPopupGettingStarted { public partial class MainPage : ContentPage { SfPopupLayout popupLayout; public MainPage() { InitializeComponent(); popupLayout = new SfPopupLayout(); var layout = new StackLayout(); var clickToShowPopup = new Button() { Text = "ClickToShowPopup", VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; layout.Children.Add(clickToShowPopup); Content = popupLayout; popupLayout.Content = layout; clickToShowPopup.Clicked += ClickToShowPopup_Clicked; popupLayout.PopupView.StartY = 100; } private void ClickToShowPopup_Clicked(object sender, EventArgs e) { popupLayout.Show(); } } }

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:SfPopupGettingStarted"
                 xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
                 x:Class="SfPopupGettingStarted.MainPage">
        <sfPopup:SfPopupLayout x:Name="popupLayout">
            <sfPopup:SfPopupLayout.PopupView>
                <sfPopup:PopupView StartY="100" >
                </sfPopup:PopupView>
            </sfPopup:SfPopupLayout.PopupView>
            <sfPopup:SfPopupLayout.Content>
                <StackLayout x:Name="layout">
                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked"/>
                </StackLayout>
            </sfPopup:SfPopupLayout.Content>
        </sfPopup:SfPopupLayout>
    </ContentPage>

    Methods

    Dispose()

    Performs final clean up before it is released from memory.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Releases the unmanaged resources used by the component and optionally releases the managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    if true - release both managed and unmanaged resources; if false - release only unmanaged resources.

    OnPropertyChanged(String)

    Method that is called when a bound property is changed.

    Declaration
    protected override void OnPropertyChanged(string propertyName = null)
    Parameters
    Type Name Description
    System.String propertyName

    Name of the property.

    Refresh()

    Refreshes the PopupView for run-time value changes.

    Declaration
    public void Refresh()

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved