menu

Xamarin.Android

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

    Show / Hide Table of Contents

    Class SfPopupLayout

    SfPopupLayout allows the user to display an alert message with the customizable buttons or load any desired view inside the pop-up.

    Inheritance
    System.Object
    SfPopupLayout
    Namespace: Syncfusion.Android.PopupLayout
    Assembly: Syncfusion.SfPopupLayout.Android.dll
    Syntax
    public class SfPopupLayout : RelativeLayout

    Constructors

    SfPopupLayout(Context)

    Initializes a new instance of the SfPopupLayout class.

    Declaration
    public SfPopupLayout(Context context)
    Parameters
    Type Name Description
    Android.Content.Context context

    The Android.Content.Context.

    SfPopupLayout(Context, IAttributeSet)

    Initializes a new instance of the SfPopupLayout class.

    Declaration
    public SfPopupLayout(Context context, IAttributeSet attributeSet)
    Parameters
    Type Name Description
    Android.Content.Context context

    The Android.Content.Context.

    Android.Util.IAttributeSet attributeSet

    The Android.Util.IAttributeSet.

    SfPopupLayout(Context, IAttributeSet, Int32)

    Initializes a new instance of the SfPopupLayout class.

    Declaration
    public SfPopupLayout(Context context, IAttributeSet attributeSet, int definedStyle)
    Parameters
    Type Name Description
    Android.Content.Context context

    The Android.Content.Context.

    Android.Util.IAttributeSet attributeSet

    The Android.Util.IAttributeSet.

    System.Int32 definedStyle

    The value indicating the defined style.

    SfPopupLayout(Context, IAttributeSet, Int32, Int32)

    Initializes a new instance of the SfPopupLayout class.

    Declaration
    public SfPopupLayout(Context context, IAttributeSet attribute, int defaultStyleAttribute, int defaultStyleResource)
    Parameters
    Type Name Description
    Android.Content.Context context

    The Android.Content.Context.

    Android.Util.IAttributeSet attribute

    The Android.Util.IAttributeSet.

    System.Int32 defaultStyleAttribute

    The value indicating the defined style

    System.Int32 defaultStyleResource

    The value indicating the defined resource.

    SfPopupLayout(IntPtr, JniHandleOwnership)

    Initializes a new instance of the SfPopupLayout class.

    Declaration
    public SfPopupLayout(IntPtr javaReference, JniHandleOwnership transfer)
    Parameters
    Type Name Description
    System.IntPtr javaReference

    The System.IntPtr.

    Android.Runtime.JniHandleOwnership transfer

    The Android.Runtime.JniHandleOwnership.

    Properties

    ClosePopupOnBackButtonPressed

    Gets or sets a value indicating whether the PopupView should be closed, when interacting with the back button.

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

    The value indicating whether the PopupView should be closed, when interacting with the back button.

    Remarks

    The PopupView will be closed based on this value, while interacting with the back button, Default value is true.

    Content

    Gets or sets the content of the SfPopupLayout which is the hosting view of the SfPopupLayout.

    Declaration
    public View Content { get; set; }
    Property Value
    Type Description
    Android.Views.View

    The content of the SfPopupLayout.

    Remarks

    The PopupView will be hosted inside the view which is set as the Content.

    IsOpen

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

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

    The value indicating whether the PopupView is open or not.

    Remarks

    The PopupView will be opened and closed based on this value.

    PopupView

    Gets or sets the popup view of the SfPopupLayout that will be displayed when setting the IsOpen property as true.

    Declaration
    public PopupView PopupView { get; }
    Property Value
    Type Description
    PopupView

    The popup view of the SfPopupLayout that will be displayed when setting the IsOpen property as true.

    ShowOverlayAlways

    Gets or sets a value indicating whether an overlay can be shown around the PopupView. Default value is false.

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

    StaysOpen

    Gets or sets a value indicating whether the PopupView should stay open, when the interaction is made outside its boundary area.

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

    The value indicating whether the PopupView should stay open, when the interaction is made outside its boundary area.

    Methods

    Dismiss()

    Dismisses the pop-up from the view.

    Declaration
    public void Dismiss()

    Dispose()

    Perform final clean up before it is released from memory.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Disposes the objects in the SfPopupLayout.

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

    Value indicating whether to dispose the objects or not.

    OnInterceptTouchEvent(MotionEvent)

    This method fires when touch is intercepted in the view.

    Declaration
    public override bool OnInterceptTouchEvent(MotionEvent ev)
    Parameters
    Type Name Description
    Android.Views.MotionEvent ev

    The motion event being dispatched down the hierarchy.

    Returns
    Type Description
    System.Boolean

    Returns true if the touch is handled.

    OnKeyDown(Keycode, KeyEvent)

    Handles the KeyDown press in device.

    Declaration
    public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
    Parameters
    Type Name Description
    Android.Views.Keycode keyCode

    A key code that represents the button pressed.

    Android.Views.KeyEvent e

    The KeyEvent object that defines the button action.

    Returns
    Type Description
    System.Boolean

    Returns True, if Popup is open. Else returns false.

    Show()

    Displays the Popup in the view.

    Declaration
    public void Show()

    Show(View)

    Displays the Popup in the view.

    Declaration
    public void Show(View rootView = null)
    Parameters
    Type Name Description
    Android.Views.View rootView

    The root view of the Activity, if the root view is not SfPopupLayout.

    Show(Int32, Int32)

    Displays the popup at the given x and y point.

    Declaration
    public void Show(int xPosition, int yPosition)
    Parameters
    Type Name Description
    System.Int32 xPosition

    The x-point at which the popup should be displayed.

    System.Int32 yPosition

    The y-point at which the popup should be displayed.

    Show(Int32, Int32, View)

    Displays the popup at the given x and y point.

    Declaration
    public void Show(int xPosition, int yPosition, View rootView = null)
    Parameters
    Type Name Description
    System.Int32 xPosition

    The x-point at which the popup should be displayed.

    System.Int32 yPosition

    The y-point at which the popup should be displayed.

    Android.Views.View rootView

    The root view of the Activity, if the root view is not SfPopupLayout.

    ShowAtTouchPoint()

    Displays the Popup at the touch point.

    Declaration
    public void ShowAtTouchPoint()

    ShowRelativeToView(View, RelativePosition, View)

    Displays popup, relative to the given view.

    Declaration
    public void ShowRelativeToView(View relativeView, RelativePosition relativePosition, View rootView = null)
    Parameters
    Type Name Description
    Android.Views.View relativeView

    The view relative to which popup should be displayed.

    RelativePosition relativePosition

    The position, where popup should be displayed,

    The root view of the Activity, if the root view is not SfPopupLayout. relative to the given view.
    Android.Views.View rootView

    ShowRelativeToView(View, RelativePosition, Double, Double)

    Displays popup, relative to the given view.

    Declaration
    public void ShowRelativeToView(View relativeView, RelativePosition relativePosition, double absoluteX = NaN, double absoluteY = NaN)
    Parameters
    Type Name Description
    Android.Views.View relativeView

    The view relative to which popup should be displayed.

    RelativePosition 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 X Point where the popup should be positioned from the relative view

    Events

    Closed

    This event will be fired whenever the PopupView 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.

    Closing

    This event will be fired whenever the 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>

    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.

    Opening

    This event will be fired whenever the PopupView 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>
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved