menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class SfPopup - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfPopup

    SfPopup displays an alert message with customizable buttons or loads a desired view within a pop-up window.

    Inheritance
    System.Object
    SfView
    SfPopup
    Implements
    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<Microsoft.Maui.IView>
    System.Collections.Generic.ICollection<Microsoft.Maui.IView>
    System.Collections.Generic.IEnumerable<Microsoft.Maui.IView>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.ICrossPlatformLayout
    Microsoft.Maui.IVisualTreeElement
    Inherited Members
    SfView.Children
    SfView.ClipToBounds
    Namespace: Syncfusion.Maui.Toolkit.Popup
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class SfPopup : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IParentThemeElement, IThemeElement

    Constructors

    SfPopup()

    Initializes a new instance of the SfPopup class.

    Declaration
    public SfPopup()

    Fields

    AbsoluteXProperty

    Identifies the AbsoluteX bindable property.

    Declaration
    public static readonly BindableProperty AbsoluteXProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AbsoluteYProperty

    Identifies the AbsoluteY bindable property.

    Declaration
    public static readonly BindableProperty AbsoluteYProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AcceptButtonTextProperty

    Identifies the AcceptButtonText bindable property.

    Declaration
    public static readonly BindableProperty AcceptButtonTextProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AcceptCommandProperty

    Identifies the AcceptCommand bindable property.

    Declaration
    public static readonly BindableProperty AcceptCommandProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AnimationDurationProperty

    Identifies the AnimationDuration bindable property.

    Declaration
    public static readonly BindableProperty AnimationDurationProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AnimationEasingProperty

    Identifies the AnimationEasing bindable property.

    Declaration
    public static readonly BindableProperty AnimationEasingProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AnimationModeProperty

    Identifies the AnimationMode bindable property.

    Declaration
    public static readonly BindableProperty AnimationModeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AppearanceModeProperty

    Identifies the AppearanceMode bindable property.

    Declaration
    public static readonly BindableProperty AppearanceModeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AutoCloseDurationProperty

    Identifies the AutoCloseDuration bindable property.

    Declaration
    public static readonly BindableProperty AutoCloseDurationProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    AutoSizeModeProperty

    Identifies the AutoSizeMode bindable property.

    Declaration
    public static readonly BindableProperty AutoSizeModeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    ContentTemplateProperty

    Identifies the ContentTemplate bindable property.

    Declaration
    public static readonly BindableProperty ContentTemplateProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    DeclineButtonTextProperty

    Identifies the DeclineButtonText bindable property.

    Declaration
    public static readonly BindableProperty DeclineButtonTextProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    DeclineCommandProperty

    Identifies the DeclineCommand bindable property.

    Declaration
    public static readonly BindableProperty DeclineCommandProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    FooterHeightProperty

    Identifies the FooterHeight bindable property.

    Declaration
    public static readonly BindableProperty FooterHeightProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    FooterTemplateProperty

    Identifies the FooterTemplate bindable property.

    Declaration
    public static readonly BindableProperty FooterTemplateProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    HeaderHeightProperty

    Identifies the HeaderHeight bindable property.

    Declaration
    public static readonly BindableProperty HeaderHeightProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    HeaderTemplateProperty

    Identifies the HeaderTemplate bindable property.

    Declaration
    public static readonly BindableProperty HeaderTemplateProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    HeaderTitleProperty

    Identifies the HeaderTitle bindable property.

    Declaration
    public static readonly BindableProperty HeaderTitleProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    IgnoreActionBarProperty

    Identifies the IgnoreActionBar bindable property.

    Declaration
    public static readonly BindableProperty IgnoreActionBarProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    IsFullScreenProperty

    Identifies the IsFullScreen bindable property.

    Declaration
    public static readonly BindableProperty IsFullScreenProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    IsOpenProperty

    Identifies the IsOpen bindable property.

    Declaration
    public static readonly BindableProperty IsOpenProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    MessageProperty

    Identifies the Message bindable property.

    Declaration
    public static readonly BindableProperty MessageProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    OverlayModeProperty

    Identifies the OverlayMode Microsoft.Maui.Controls.BindableProperty.

    Declaration
    public static readonly BindableProperty OverlayModeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    PaddingProperty

    Identifies the Padding bindable property.

    Declaration
    public static readonly BindableProperty PaddingProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    PopupStyleProperty

    Identifies the PopupStyle bindable property.

    Declaration
    public static readonly BindableProperty PopupStyleProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    RelativePositionProperty

    Identifies the RelativePosition bindable property.

    Declaration
    public static readonly BindableProperty RelativePositionProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    RelativeViewProperty

    Identifies the RelativeView bindable property.

    Declaration
    public static readonly BindableProperty RelativeViewProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    ShowCloseButtonProperty

    Identifies the ShowCloseButton bindable property.

    Declaration
    public static readonly BindableProperty ShowCloseButtonProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    ShowFooterProperty

    Identifies the ShowFooter bindable property.

    Declaration
    public static readonly BindableProperty ShowFooterProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    ShowHeaderProperty

    Identifies the ShowHeader bindable property.

    Declaration
    public static readonly BindableProperty ShowHeaderProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    ShowOverlayAlwaysProperty

    Identifies the ShowOverlay bindable property.

    Declaration
    public static readonly BindableProperty ShowOverlayAlwaysProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    StartXProperty

    Identifies the StartX bindable property.

    Declaration
    public static readonly BindableProperty StartXProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    StartYProperty

    Identifies the StartY bindable property.

    Declaration
    public static readonly BindableProperty StartYProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    StaysOpenProperty

    Identifies the StaysOpen bindable property.

    Declaration
    public static readonly BindableProperty StaysOpenProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    Properties

    AbsoluteX

    Gets or sets the absolute x-point to display a pop-up when positioning it relatively to the specified RelativeView based on the RelativePosition. The pop-up will be displayed based on this property value only when relatively displaying it by using the RelativeView property.

    Declaration
    public int AbsoluteX { get; set; }
    Property Value
    Type
    System.Int32
    Examples

    The following code example demonstrates how to set AbsoluteX property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AbsoluteX="100">
    See Also
    RelativePosition
    RelativeView
    AbsoluteY
    ShowRelativeToView(View, PopupRelativePosition, Double, Double)
    IsOpen
    Show(Boolean)

    AbsoluteY

    Gets or sets the absolute y-point to display a pop-up when positioning it relatively to the specified RelativeView based on the RelativePosition. The pop-up will be displayed based on this property value only when relatively displaying it by using the RelativeView property.

    Declaration
    public int AbsoluteY { get; set; }
    Property Value
    Type
    System.Int32
    Examples

    The following code example demonstrates how to set AbsoluteY property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AbsoluteY="100">
    See Also
    RelativePosition
    RelativeView
    AbsoluteX
    ShowRelativeToView(View, PopupRelativePosition, Double, Double)
    IsOpen
    Show(Boolean)

    AcceptButtonText

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

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

    The following code example demonstrates how to set AcceptButtonText property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AccpetButtonText="OK">
    See Also
    FooterTemplate
    FooterHeight
    FooterBackground
    AcceptButtonTextColor
    DeclineButtonTextColor
    FooterFontAttribute
    FooterFontFamily
    FooterFontSize

    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

    Here is an example of how to set the AcceptCommand property

    • XAML
    • C#
    <popup:SfPopup AcceptComand="Binding PopupAcceptCommand}" />
    public class PopupViewModel
    {
    	public ICommand PopupAcceptCommand { get; set; }
    	public PopupViewModel()
    	{
    		PopupAcceptCommand = new Command(PopupAccept);
    	}
    
    	private void PopupAccept()
    	{
    		// You can write your set of codes that needs to be executed.
    	}
    }
    See Also
    AppearanceMode
    Opening
    Opened
    Closing
    Closed

    AnimationDuration

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

    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 popup view.

    Examples

    The following code example demonstrates how to set AnimationDuration property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AnimationDuration="100">

    AnimationEasing

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

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

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

    Examples

    The following code example demonstrates how to set AnimationEasing property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AnimationEasing="SinIn">

    AnimationMode

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

    Declaration
    public PopupAnimationMode AnimationMode { get; set; }
    Property Value
    Type
    PopupAnimationMode
    Examples

    The following code example demonstrates how to set AnimationMode property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AnimationMode="Fade">

    AppearanceMode

    Gets or sets the type of layout template of the popup view.

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

    PopupButtonAppearanceMode.OneButton displays a single button in the popup view footer. PopupButtonAppearanceMode.TwoButton displays two buttons in the _popupView footer.

    Examples

    The following code example demonstrates how to set AppearanceMode property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AppearanceMode="OneButton">
    See Also
    PopupStyle
    FooterTemplate
    FooterHeight
    AcceptButtonText
    DeclineButtonText
    AcceptCommand
    DeclineCommand

    AutoCloseDuration

    Gets or sets the time delay in milliseconds for automatically closing the SfPopup.

    Declaration
    public int AutoCloseDuration { get; set; }
    Property Value
    Type
    System.Int32
    Examples

    The following code example demonstrates how to set AutoCloseDuration property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AutoCloseDuration="500">

    AutoSizeMode

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

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

    The default value is None.

    Remarks

    AutoSizeMode will be applied to SfPopup only if ContentTemplate is defined.

    Examples

    The following code example demonstrates how to set AutoSizeMode property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					AutoSizeMode="Both">
    See Also
    ContentTemplate

    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
    Microsoft.Maui.Controls.DataTemplate

    Gets or sets the template to be loaded in the body of the Syncfusion.Maui.Toolkit.Popup.SfPopup._popupView. The default value is null.

    Remarks

    PopupStyle does not apply to templated elements.

    Examples

    The following code example demonstrates how to set ContentTemplate property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup">
             <syncfusion:SfPopup.ContentTemplate>
                 <DataTemplate>
                     <Label Text = "This is SfPopup"
                            BackgroundColor="SkyBlue"
                            HorizontalTextAlignment="Center"/>
                 </DataTemplate>
             </syncfusion:SfPopup.ContentTemplate>
     </syncfusion:SfPopup>
    See Also
    Message
    FooterTemplate
    HeaderTemplate
    AutoSizeMode
    PopupStyle

    DeclineButtonText

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

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

    The following code example demonstrates how to set DeclineButtonText property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					DeclineButtonText="Cancel">
    See Also
    FooterTemplate
    FooterHeight
    FooterBackground
    AcceptButtonTextColor
    DeclineButtonTextColor
    FooterFontAttribute
    FooterFontFamily
    FooterFontSize

    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

    Here is an example of how to set the DeclineCommand property

    • XAML
    • C#
    <popup:SfPopup AcceptComand="Binding PopupDeclineCommand}" />
    public class PopupViewModel
    {
    	public ICommand PopupDeclineCommand { get; set; }
    	public PopupViewModel()
    	{
    		PopupDeclineCommand = new Command(PopupDecline);
    	}
    
    	private void PopupDecline()
    	{
    		// You can write your set of codes that needs to be executed.
    	}
    }
    See Also
    AppearanceMode
    Opening
    Opened
    Closing
    Closed

    FooterHeight

    Gets or sets the footer height of the popup view.

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

    The following code example demonstrates how to set FooterHeight property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					FooterHeight="100">
    See Also
    FooterTemplate
    ShowFooter

    FooterTemplate

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

    Declaration
    public DataTemplate FooterTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.DataTemplate

    The template to be loaded in the footer of the popup view,The default value is null.

    Remarks

    PopupStyle does not apply to templated elements. ShowFooter need to be enabled to display footer.

    Examples

    The following code example demonstrates how to set FooterTemplate property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup">
    	<syncfusion:SfPopup.FooterTemplate>
    		<DataTemplate>
    			<Label Text = "Customized Footer"
    				   FontAttributes="Bold"
                       BackgroundColor="Blue"
                       FontSize="16"
                       HorizontalTextAlignment="Center"
                       VerticalTextAlignment="Center"/>
            </DataTemplate>
    	</syncfusion:SfPopup.FooterTemplate>
    </syncfusion:SfPopup>
    See Also
    FooterTemplate
    ContentTemplate
    ShowFooter
    FooterHeight
    AppearanceMode
    AcceptButtonText
    DeclineButtonText
    AcceptCommand
    DeclineCommand
    PopupStyle

    HeaderHeight

    Gets or sets the header height of the popup view.

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

    The following code example demonstrates how to set HeaderHeight property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					HeaderHeight="100">
    See Also
    HeaderTemplate
    HeaderTitle
    ShowHeader

    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
    Microsoft.Maui.Controls.DataTemplate

    Gets or sets the template to be loaded in the header of the Syncfusion.Maui.Toolkit.Popup.SfPopup._popupView. The default value is null.

    Remarks

    PopupStyle does not apply to templated elements.

    Examples

    The following code example demonstrates how to set HeaderTemplate property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup">
         <syncfusion:SfPopup.HeaderTemplate>
             <DataTemplate>
                 <Label Text = "Customized Header"
                    FontAttributes="Bold"
                    BackgroundColor="Blue"
                    FontSize="16"
                    HorizontalTextAlignment="Center"
                    VerticalTextAlignment="Center"/>
             </DataTemplate>
         </syncfusion:SfPopup.HeaderTemplate>
     </syncfusion:SfPopup>
    See Also
    HeaderTitle
    FooterTemplate
    ShowCloseButton
    ContentTemplate
    HeaderHeight
    PopupStyle

    HeaderTitle

    Gets or sets the header title of the popup view.

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

    The following code example demonstrates how to set HeaderTitle property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					HeaderTitle="PopupHeader">
    See Also
    HeaderTemplate
    ShowCloseButton
    HeaderHeight
    HeaderBackground
    HeaderTextColor
    HeaderFontAttribute
    HeaderFontFamily
    HeaderFontSize
    HeaderTextAlignment

    IgnoreActionBar

    Gets or sets a value indicating whether the action bar bounds should be considered while positioning the SfPopup .

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

    true to consider the action bar area to position the SfPopup. otherwise, false.

    Examples

    The following code example demonstrates how to set IgnoreActionBar property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					IgnoreActionBar="True">

    IsFullScreen

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

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

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

    Examples

    The following code example demonstrates how to set IsFullScreen property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					IsFullScreen="True">
    See Also
    IsOpen
    Show(Boolean)

    IsOpen

    Gets or sets a value indicating whether the popup view is open or not.

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

    The value indicating whether the popup view is open or not.

    Remarks

    The popup view will be opened and closed based on this value.

    Examples

    The following code example demonstrates how to set IsOpen property for the SfPopup control.

    void clickToShowPopup_Clicked(object sender, EventArgs e)
    {
        popup.IsOpen = true;
    }
    <syncfusion:SfPopup x:Name="popup" IsOpen="True"/>
    See Also
    Opening
    Opened
    Closing
    Closed
    Show(Boolean)
    Show(Double, Double)
    ShowRelativeToView(View, PopupRelativePosition, Double, Double)

    Message

    Gets or sets the popup message of the popup view.

    Declaration
    public string Message { get; set; }
    Property Value
    Type
    System.String
    Examples

    The following code example demonstrates how to set Message property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					Message="Popup Content">
    See Also
    ContentTemplate
    MessageBackground
    MessageTextColor

    OverlayMode

    Gets or sets a value indicating whether overlay should be transparent or blurred.

    Declaration
    public PopupOverlayMode OverlayMode { get; set; }
    Property Value
    Type Description
    PopupOverlayMode

    OverlayMode.Blur If the overlay should be blurred otherwiseOverlayMode.Transparent.The default value is OverlayMode.Transparent.

    Remarks

    OverlayMode.Blur will be applied to android 31 and above. In below android 31, OverlayMode.Transparent will be applied by default.

    Examples

    The following code example demonstrates how to set OverlayMode property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					OverlayMode="Blur">
    See Also
    ShowOverlayAlways
    OverlayColor
    BlurIntensity
    BlurRadius

    Padding

    Gets or sets the padding space between popup overlay and the popupView.

    Declaration
    public Thickness Padding { get; set; }
    Property Value
    Type
    Microsoft.Maui.Thickness
    Remarks

    The popupView will be padded inside the overlay when the popupView bounds intersect the padding region.

    PopupStyle

    Gets or sets the style to be applied to the _popupView in SfPopup.

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

    The following code example demonstrates how to set PopupStyle property for the SfPopup control.

    <popup:SfPopup x:Name="popup">
    	<popup:SfPopup.PopupStyle>
    	    <popup:PopupStyle PopupBackground="#C3B0D6" />
    	</popup:SfPopup.PopupStyle>
    </popup:SfPopup>

    RelativePosition

    Gets or sets the relative position, where the pop-up should be displayed relatively to RelativeView. The relative position can also be absolutely adjusted using the AbsoluteX and AbsoluteY properties.

    Declaration
    public PopupRelativePosition RelativePosition { get; set; }
    Property Value
    Type
    PopupRelativePosition
    Examples

    The following code example demonstrates how to set RelativePosition property for the SfPopup control.

    void clickToShowPopup_Clicked(object sender, EventArgs e)
    {
        popup.Show();
    }
    <StackLayout WidthRequest = "500" >
       <Button x:Name="setRelativeView" Text="Set Relative" />
       <syncfusion:SfPopup x:Name="popup" AbsoluteX="10" AbsoluteY="10" RelativeView="{x:Reference setRelativeView}" RelativePosition="AlignBottom"/>
       <Button x:Name="clickToShowPopup" Text="Click To Show Popup" Clicked="clickToShowPopup_Clicked"/>
    </StackLayout>
    See Also
    RelativeView
    AbsoluteX
    AbsoluteY
    ShowRelativeToView(View, PopupRelativePosition, Double, Double)
    IsOpen
    Show(Boolean)

    RelativeView

    Gets or sets the view relative to which the popup should be displayed based on the RelativePosition. The relative position can also be absolutely adjusted using the AbsoluteX and AbsoluteY properties.

    Declaration
    public View RelativeView { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.View

    The relative position can also be absolutely adjusted using the AbsoluteX and AbsoluteY properties.

    Remarks

    Positions the SfPopup relative to a specified view, with options for absolute positioning or relative alignment.

    Examples

    The following code example demonstrates how to set RelativeView property for the SfPopup control.

    void clickToShowPopup_Clicked(object sender, EventArgs e)
    {
        popup.Show();
    }
    <StackLayout WidthRequest = "500" >
       <Button x:Name="setRelativeView" Text="Set Relative" />
       <syncfusion:SfPopup x:Name="popup" AbsoluteX="10" AbsoluteY="10" RelativeView="{x:Reference setRelativeView}" RelativePosition="AlignBottom"/>
       <Button x:Name="clickToShowPopup" Text="Click To Show Popup" Clicked="clickToShowPopup_Clicked"/>
    </StackLayout>
    See Also
    RelativePosition
    AbsoluteX
    AbsoluteY
    ShowRelativeToView(View, PopupRelativePosition, Double, Double)
    IsOpen
    Show(Boolean)

    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
    System.Boolean
    Examples

    The following code example demonstrates how to set ShowCloseButton property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					ShowCloseButton="True">
    See Also
    HeaderTitle
    HeaderTemplate
    ShowHeader
    CloseButtonIcon

    ShowFooter

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

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

    true if show footer; otherwise, false. The default value is false.

    Examples

    The following code example demonstrates how to set ShowFooter property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					ShowFooter="True">
    See Also
    FooterTemplate
    FooterHeight
    AppearanceMode
    AcceptButtonText
    DeclineButtonText
    AcceptCommand
    DeclineCommand

    ShowHeader

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

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

    The following code example demonstrates how to set ShowHeader property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					ShowHeader="True">
    See Also
    ShowCloseButton
    HeaderHeight
    HeaderTemplate
    HeaderTitle

    ShowOverlayAlways

    Gets or Sets a value indicating whether an overlay can be shown around the Syncfusion.Maui.Toolkit.Popup.SfPopup._popupView.

    Declaration
    public bool ShowOverlayAlways { get; set; }
    Property Value
    Type
    System.Boolean
    Examples

    The following code example demonstrates how to set ShowOverlayAlways property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					ShowOverlayAlways="True">
    See Also
    OverlayMode
    OverlayColor
    BlurIntensity
    BlurRadius

    StartX

    Gets or sets the x-position of the _popupView.

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

    The following code example demonstrates how to set StartX property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					StartX="100">

    StartY

    Gets or sets the y-position of the _popupView.

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

    The following code example demonstrates how to set StartY property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					StartY="100">

    StaysOpen

    Gets or sets a value indicating whether the Syncfusion.Maui.Toolkit.Popup.SfPopup._popupView should be opened, when interacting outside its boundary area.

    Declaration
    public bool StaysOpen { get; set; }
    Property Value
    Type
    System.Boolean
    Examples

    The following code example demonstrates how to set StaysOpen property for the SfPopup control.

    <syncfusion:SfPopup x:Name="popup" 
    					StaysOpen="True">
    See Also
    ShowCloseButton

    Methods

    Dismiss()

    Dismisses the Syncfusion.Maui.Toolkit.Popup.SfPopup._popupView from the view.

    Declaration
    public void Dismiss()
    Examples

    The following code demonstrates how to dismiss the SfPopup.

    void DismissButton_Clicked(object sender, EventArgs e)
    {
    	popup.Dismiss();	
    }

    OnBindingContextChanged()

    Occurs when the popup view binding context is changed.

    Declaration
    protected override void OnBindingContextChanged()
    Overrides
    Syncfusion.Maui.Toolkit.SfView.OnBindingContextChanged()

    OnHandlerChanged()

    Raised when the popup handler changes.

    Declaration
    protected override void OnHandlerChanged()
    Overrides
    Syncfusion.Maui.Toolkit.SfView.OnHandlerChanged()

    OnPropertyChanged(String)

    Need to handle the run time changes of System.ComponentModel.PropertyChangedEventArgs of SfPopup.

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

    Represents the property changed event arguments.

    Refresh()

    Refreshes the popup view for run-time value changes.

    Declaration
    public void Refresh()

    Show(Boolean)

    Displays the Popup in the screen.

    Declaration
    public void Show(bool isfullscreen = false)
    Parameters
    Type Name Description
    System.Boolean isfullscreen

    Specifies whether the popup should be displayed in full screen or not.

    Remarks

    The Show(Boolean) method allows you to specify whether the popup should be displayed in full screen by passing a boolean value for the isfullscreen parameter.

    Examples

    The following code example demonstrates how to display SfPopup control using Show(Boolean) method.

    void OnButton_Clicked(object sender, EventArgs e)
    {
    	popup.Show();	
    }
    See Also
    Show(Double, Double)
    ShowRelativeToView(View, PopupRelativePosition, Double, Double)
    IsOpen
    IsFullScreen

    Show(Double, Double)

    Displays the popup at the specific x and y point.

    Declaration
    public void Show(double xPosition, double yPosition)
    Parameters
    Type Name Description
    System.Double xPosition

    The x point at which the popup should be displayed.

    System.Double yPosition

    The y point at which the popup should be displayed.

    Remarks

    This method allows you to specify the exact screen coordinates where the popup should appear, based on the provided xPosition and yPosition values.

    Examples

    The following code example demonstrates how to display SfPopup control using Show(Double, Double) method.

    void OnButton_Clicked(object sender, EventArgs e)
    {
    	popup.Show(100,100);	
    }
    See Also
    Show(Boolean)
    ShowRelativeToView(View, PopupRelativePosition, Double, Double)
    IsOpen
    IsFullScreen

    Show(String, String, Int32)

    Displays a popup with the specified title and message.

    Declaration
    public static void Show(string title, string message, int autoCloseDuration = 0)
    Parameters
    Type Name Description
    System.String title

    The title of the popup.

    System.String message

    The message to be displayed in the popup.

    System.Int32 autoCloseDuration

    The delay in milliseconds after which the popup will automatically close.

    Examples

    The following code example demonstrates how to display SfPopup control using Show(String, String, Int32) method.

    void OnButton_Clicked(object sender, EventArgs e)
    {
    	popup.Show("HeaderTitle","PopupMessageView",1000);	
    }

    Show(String, String, String, Int32)

    Displays a popup with the specified title and message, along with an accept button.

    Declaration
    public static void Show(string title, string message, string acceptText, int autoCloseDuration = 0)
    Parameters
    Type Name Description
    System.String title

    The title of the popup.

    System.String message

    The message to be displayed in the popup.

    System.String acceptText

    The text to be displayed on the accept button in the footer.

    System.Int32 autoCloseDuration

    The delay in milliseconds after which the popup will automatically close.

    Examples

    The following code example demonstrates how to display SfPopup control using Show(String, String, String, Int32) method.

    void OnButton_Clicked(object sender, EventArgs e)
    {
    	popup.Show("HeaderTitle","PopupMessageView","OK",1000);	
    }

    Show(String, String, String, String, Int32)

    Displays a popup with the specified title, message, accept button, and a decline button with the provided text.

    Declaration
    public static Task<bool> Show(string title, string message, string acceptText, string declineText, int autoCloseDuration = 0)
    Parameters
    Type Name Description
    System.String title

    The title of the popup.

    System.String message

    The message to be displayed in the popup.

    System.String acceptText

    The text to be displayed on the accept button in the footer.

    System.String declineText

    The text to be displayed on the decline button in the footer.

    System.Int32 autoCloseDuration

    The delay in milliseconds after which the popup will automatically close.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    A task representing the asynchronous operation. The result will be true if the popup was closed using the accept button; otherwise, false.

    Examples

    The following code example demonstrates how to display SfPopup control using Show(String, String, String, String, Int32) method.

    void OnButton_Clicked(object sender, EventArgs e)
    {
    	popup.Show("HeaderTitle","PopupMessageView","OK","Cancel",1000);	
    }

    ShowAsync()

    Displays a Popup.

    Declaration
    public Task<bool> ShowAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    A task representing the asynchronous operation. The result will be true if the popup was closed using the accept button; otherwise, false.

    Examples

    The following code example demonstrates how to display SfPopup control using ShowAsync() method.

    async void OnButton_Clicked(object sender, EventArgs e)
    {
    	var result = await popup.ShowAsync();
    }

    ShowRelativeToView(View, PopupRelativePosition, Double, Double)

    Displays popup relative to the given view.

    Declaration
    public void ShowRelativeToView(View relativeView, PopupRelativePosition relativePosition, double absoluteX = NaN, double absoluteY = NaN)
    Parameters
    Type Name Description
    Microsoft.Maui.Controls.View relativeView

    The view relative to which popup should be displayed.

    PopupRelativePosition relativePosition

    The position where popup should be displayed relative to the given view.

    System.Double absoluteX

    Absolute x Point where the popup should be positioned from the relative view.

    System.Double absoluteY

    Absolute y Point where the popup should be positioned from the relative view.

    Remarks

    Positions the popup relative to the specified view, with optional absolute offsets. The popup is updated if already open, and blur effects are applied on Android. Resizing is recalculated if AutoSizeMode is enabled.

    Examples

    The following code example demonstrates how to display SfPopup control using ShowRelativeToView(View, PopupRelativePosition, Double, Double) method.

    void setRelativeView_Clicked(object sender, EventArgs e)
    {
    	sfPopup.ShowRelativeToView(showPopup, PopupRelativePosition.AlignToRightOf, 10, 10);
    }
    See Also
    Show(Boolean)
    Show(Double, Double)
    IsOpen
    IsFullScreen

    Events

    Closed

    This event will be fired whenever the popup view is dismissed from the view.

    Declaration
    public event EventHandler Closed
    Event Type
    Type
    System.EventHandler
    Remarks

    This event fires whenever the IsOpen property is set as false.

    Examples

    The following example demonstrates how to use the Closed event in the SfPopup control.

    # [XAML](#tab/tabid-1)
    <popup:SfPopup x:Name="popup" Closed="Popup_Closed" />
    • C#
    private void Popup_Closed(object sender, EventArgs e)
    {
    	// Codes that needs to be executed once popup is completely closed.
    }
    See Also
    Closing
    Opening
    Opened

    Closing

    This event will be fired whenever the Syncfusion.Maui.Toolkit.Popup.SfPopup._popupView is closing in the view. Occurring of this event can be cancelled based on conditions.

    Declaration
    public event EventHandler<CancelEventArgs> Closing
    Event Type
    Type
    System.EventHandler<System.ComponentModel.CancelEventArgs>
    Examples

    The following example demonstrates how to use the Closing event in the SfPopup control.

    # [XAML](#tab/tabid-1)
    <popup:SfPopup x:Name="popup" Closed="Popup_Closing" />
    • C#
    private void Popup_Closing(object sender, EventArgs e)
    {
    	// Codes that needs to be executed when the popup is closing.
    }
    See Also
    Closed
    Opening
    Opened

    Opened

    This event will be fired whenever the popupView is shown in the view.

    Declaration
    public event EventHandler Opened
    Event Type
    Type
    System.EventHandler
    Remarks

    This event fires whenever the IsOpen property is set as true.

    Examples

    The following example demonstrates how to use the Opened event in the SfPopup control.

    # [XAML](#tab/tabid-1)
    <popup:SfPopup x:Name="popup" Closed="Popup_Opened" />
    • C#
    private void Popup_Opened(object sender, EventArgs e)
    {
    	// Codes that needs to be executed once popup is opened.
    }
    See Also
    Opening
    Closing
    Closed

    Opening

    This event will be fired whenever the popup view is opening in the view. Occurring of this event can be cancelled based on conditions.

    Declaration
    public event EventHandler<CancelEventArgs> Opening
    Event Type
    Type
    System.EventHandler<System.ComponentModel.CancelEventArgs>
    Examples

    The following example demonstrates how to use the Opening event in the SfPopup control.

    # [XAML](#tab/tabid-1)
    <popup:SfPopup x:Name="popup" Closed="Popup_Opening" />
    • C#
    private void Popup_Opening(object sender, EventArgs e)
    {
    	// Codes that needs to be executed when the popup is opening.
    }
    See Also
    Opened
    Closing
    Closed

    Implements

    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<>
    System.Collections.Generic.ICollection<>
    System.Collections.Generic.IEnumerable<>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.ICrossPlatformLayout
    Microsoft.Maui.IVisualTreeElement
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved