Class SfPopup
SfPopup displays an alert message with customizable buttons or loads a desired view within a pop-up window.
Implements
Inherited Members
Namespace: Syncfusion.Maui.Popup
Assembly: Syncfusion.Maui.Popup.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 |
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 |
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 |
See Also
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 |
See Also
AcceptButtonText
Gets or sets the text of accept button in the footer.
Declaration
public string AcceptButtonText { get; set; }
Property Value
Type |
---|
System.String |
See Also
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 |
See Also
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. |
AnimationEasing
Gets or sets the animation easing effect to be applied to the PopupView'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 PopupView when it opens and closes. |
AnimationMode
Gets or sets the animation to be applied for the PopupView when opening and closing it.
Declaration
public PopupAnimationMode AnimationMode { get; set; }
Property Value
Type |
---|
PopupAnimationMode |
AppearanceMode
Gets or sets the type of layout template of the PopupView.
Declaration
public PopupButtonAppearanceMode AppearanceMode { get; set; }
Property Value
Type | Description |
---|---|
PopupButtonAppearanceMode | PopupButtonAppearanceMode.OneButton displays a single button in the PopupView footer. PopupButtonAppearanceMode.TwoButton displays two buttons in the PopupView footer. |
See Also
AutoCloseDuration
Gets or sets the time delay in milliseconds for automatically closing the Popup.
Declaration
public int AutoCloseDuration { get; set; }
Property Value
Type |
---|
System.Int32 |
AutoSizeMode
Gets or sets a value that determines how to size the PopupView 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.
See Also
ContentTemplate
Gets or sets the template to be loaded in the body of the PopupView.
Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
Remarks
PopupStyle does not apply to templated elements.
Examples
The following code example demonstrates how to set ContentTemplate property for the SfPopup control.
using System.ComponentModel;
namespace PopupMAUI
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void clickToShowPopup_Clicked(object sender, EventArgs e)
{
(this.BindingContext as ViewModel).IsOpen = true;
}
}
}
<?xml version = "1.0" encoding="utf-8" ?>
<ContentPage xmlns = "http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Popup;assembly=Syncfusion.Maui.Popup"
xmlns:local="clr-namespace:PopupMAUI"
x:Class="PopupMAUI.MainPage">
<ContentPage.BindingContext>
<local:ViewModel/>
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout WidthRequest = "500" >
<Button x:Name="setRelativeView" Text="Set Relative" />
<syncfusion:SfPopup x:Name="popup" IsOpen="{Binding IsOpen}">
<syncfusion:SfPopup.ContentTemplate>
<DataTemplate>
<Label Text = "This is SfPopup"
BackgroundColor="SkyBlue"
HorizontalTextAlignment="Center"/>
</DataTemplate>
</syncfusion:SfPopup.ContentTemplate>
</syncfusion:SfPopup>
<Button x:Name="clickToShowPopup" Text="Click To Show Popup" Clicked="clickToShowPopup_Clicked"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
See Also
DeclineButtonText
Gets or sets the text of decline button in the footer.
Declaration
public string DeclineButtonText { get; set; }
Property Value
Type |
---|
System.String |
See Also
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 |
See Also
FooterHeight
Gets or sets the footer height of the PopupView.
Declaration
public int FooterHeight { get; set; }
Property Value
Type |
---|
System.Int32 |
See Also
FooterTemplate
Gets or sets the template to be loaded in the footer of the PopupView.
Declaration
public DataTemplate FooterTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
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.
using System.ComponentModel;
namespace PopupMAUI
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void clickToShowPopup_Clicked(object sender, EventArgs e)
{
(this.BindingContext as ViewModel).IsOpen = true;
}
}
}
<?xml version = "1.0" encoding="utf-8" ?>
<ContentPage xmlns = "http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Popup;assembly=Syncfusion.Maui.Popup"
xmlns:local="clr-namespace:PopupMAUI"
x:Class="PopupMAUI.MainPage">
<ContentPage.BindingContext>
<local:ViewModel/>
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout WidthRequest = "500" >
<Button x:Name="setRelativeView" Text="Set Relative" />
<syncfusion:SfPopup x:Name="popup" IsOpen="{Binding IsOpen}" ShowFooter="True">
<syncfusion:SfPopup.FooterTemplate>
<DataTemplate>
<Label Text = "Customized Footer"
FontAttributes="Bold"
BackgroundColor="Blue"
FontSize="16"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"/>
</DataTemplate>
</syncfusion:SfPopup.FooterTemplate>
</syncfusion:SfPopup>
<Button x:Name="clickToShowPopup" Text="Click To Show Popup" Clicked="clickToShowPopup_Clicked"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
See Also
HeaderHeight
Gets or sets the header height of the PopupView.
Declaration
public int HeaderHeight { get; set; }
Property Value
Type |
---|
System.Int32 |
See Also
HeaderTemplate
Gets or sets the template to be loaded in the header of the PopupView.
Declaration
public DataTemplate HeaderTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
Remarks
PopupStyle does not apply to templated elements.
Examples
The following code example demonstrates how to set HeaderTemplate property for the SfPopup control.
using System.ComponentModel;
namespace PopupMAUI
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void clickToShowPopup_Clicked(object sender, EventArgs e)
{
(this.BindingContext as ViewModel).IsOpen = true;
}
}
}
<?xml version = "1.0" encoding="utf-8" ?>
<ContentPage xmlns = "http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Popup;assembly=Syncfusion.Maui.Popup"
xmlns:local="clr-namespace:PopupMAUI"
x:Class="PopupMAUI.MainPage">
<ContentPage.BindingContext>
<local:ViewModel/>
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout WidthRequest = "500" >
<Button x:Name="setRelativeView" Text="Set Relative" />
<syncfusion:SfPopup x:Name="popup" IsOpen="{Binding IsOpen}">
<syncfusion:SfPopup.HeaderTemplate>
<DataTemplate>
<Label Text = "Customized Header"
FontAttributes="Bold"
BackgroundColor="Blue"
FontSize="16"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"/>
</DataTemplate>
</syncfusion:SfPopup.HeaderTemplate>
</syncfusion:SfPopup>
<Button x:Name="clickToShowPopup" Text="Click To Show Popup" Clicked="clickToShowPopup_Clicked"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
See Also
HeaderTitle
Gets or sets the header title of the PopupView.
Declaration
public string HeaderTitle { get; set; }
Property Value
Type |
---|
System.String |
See Also
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 |
---|
System.Boolean |
Remarks
If IsFullScreen is set as true, the height request and width request given for the PopupView will not be considered.
See Also
IsOpen
Gets or sets a value indicating whether the Syncfusion.Maui.Popup.SfPopup.PopupView is open or not.
Declaration
public bool IsOpen { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The value indicating whether the Syncfusion.Maui.Popup.SfPopup.PopupView is open or not. |
Remarks
The Syncfusion.Maui.Popup.SfPopup.PopupView will be opened and closed based on this value.
Examples
The following code example demonstrates how to set IsOpen property for the SfPopup control.
using System.ComponentModel;
namespace PopupMAUI
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void clickToShowPopup_Clicked(object sender, EventArgs e)
{
(this.BindingContext as ViewModel).IsOpen = true;
}
}
}
<?xml version = "1.0" encoding="utf-8" ?>
<ContentPage xmlns = "http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Popup;assembly=Syncfusion.Maui.Popup"
xmlns:local="clr-namespace:PopupMAUI"
x:Class="PopupMAUI.MainPage">
<ContentPage.BindingContext>
<local:ViewModel/>
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout WidthRequest = "500" >
<syncfusion:SfPopup x:Name="popup" IsOpen="{Binding IsOpen}"/>
<Button x:Name="clickToShowPopup" Text="Click To Show Popup" Clicked="clickToShowPopup_Clicked"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
See Also
Message
Gets or sets the popup message of the PopupView.
Declaration
public string Message { get; set; }
Property Value
Type |
---|
System.String |
See Also
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.
See Also
PopupStyle
Gets or sets the style to be applied to the PopupView in SfPopup.
Declaration
public PopupStyle PopupStyle { get; set; }
Property Value
Type |
---|
PopupStyle |
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 |
See Also
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 |
---|
Microsoft.Maui.Controls.View |
Examples
The following code example demonstrates how to set RelativeView property for the SfPopup control.
using System.ComponentModel;
namespace PopupMAUI
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void clickToShowPopup_Clicked(object sender, EventArgs e)
{
(this.BindingContext as ViewModel).IsOpen = true;
}
}
}
<?xml version = "1.0" encoding="utf-8" ?>
<ContentPage xmlns = "http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Popup;assembly=Syncfusion.Maui.Popup"
xmlns:local="clr-namespace:PopupMAUI"
x:Class="PopupMAUI.MainPage">
<ContentPage.BindingContext>
<local:ViewModel/>
</ContentPage.BindingContext>
<ContentPage.Content>
<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" IsOpen="{Binding IsOpen}"/>
<Button x:Name="clickToShowPopup" Text="Click To Show Popup" Clicked="clickToShowPopup_Clicked"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
See Also
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 |
See Also
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 |
|
See Also
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 |
---|
System.Boolean |
See Also
ShowOverlayAlways
Gets or Sets a value indicating whether an overlay can be shown around the Syncfusion.Maui.Popup.SfPopup.PopupView.
Declaration
public bool ShowOverlayAlways { get; set; }
Property Value
Type |
---|
System.Boolean |
See Also
StartX
Gets or sets the x-position of the PopupView.
Declaration
public int StartX { get; set; }
Property Value
Type |
---|
System.Int32 |
StartY
Gets or sets the y-position of the PopupView.
Declaration
public int StartY { get; set; }
Property Value
Type |
---|
System.Int32 |
StaysOpen
Gets or sets a value indicating whether the Syncfusion.Maui.Popup.SfPopup.PopupView should be opened, when interacting outside its boundary area.
Declaration
public bool StaysOpen { get; set; }
Property Value
Type |
---|
System.Boolean |
See Also
Methods
Dismiss()
Dismisses the Syncfusion.Maui.Popup.SfPopup.PopupView from the view.
Declaration
public void Dismiss()
OnBindingContextChanged()
Occurs when the PopupView binding context is changed.
Declaration
protected override void OnBindingContextChanged()
Overrides
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 Syncfusion.Maui.Popup.SfPopup.PopupView 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. |
Examples
The following code example demonstrates how to display SfPopup control using Show(Boolean) method.
using System.ComponentModel;
namespace PopupMAUI
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
SfPopup popup = new SfPopup();
popup.Show();
}
}
}
See Also
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. |
Examples
The following code example demonstrates how to display SfPopup control using Show(Double, Double) method.
using System.ComponentModel;
namespace PopupMAUI
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
SfPopup popup = new SfPopup();
popup.Show(100, 100);
}
}
}
See Also
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. |
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. |
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. |
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. |
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. |
Examples
The following code example demonstrates how to display SfPopup control using ShowRelativeToView(View, PopupRelativePosition, Double, Double) method.
using System.ComponentModel;
namespace PopupMAUI
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
SfPopup popup = new SfPopup();
}
}
private void setRelativeView_Clicked(object sender, EventArgs e)
{
sfPopup.ShowRelativeToView(showPopup, PopupRelativePosition.AlignToRightOf, 10, 10);
}
}
See Also
Events
Closed
This event will be fired whenever the Syncfusion.Maui.Popup.SfPopup.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
.
See Also
Closing
This event will be fired whenever the Syncfusion.Maui.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> |
See Also
Opened
This event will be fired whenever the Syncfusion.Maui.Popup.SfPopup.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
.
See Also
Opening
This event will be fired whenever the Syncfusion.Maui.Popup.SfPopup.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> |