18 Nov 20183 minutes to read
To make migration easier from Xamarin.Forms SfPopupLayout to .NET MAUI SfPopup, we kept most of the APIs from Xamarin SfPopupLayout in .NET MAUI SfPopup. However, to maintain the consistency of API naming in .NET MAUI SfPopup, we renamed some of the APIs. The APIs that have been changed in .NET MAUI SfPopup from Xamarin SfPopupLayout are detailed as follows.
Namespaces
| Xamarin SfPopupLayout |
.NET MAUI SfPopup |
| Syncfusion.XForms.SfPopupLayout |
Syncfusion.Maui.Popup |
Initialize Control
To initialize the control, import the popup namespace and initialize SfPopup as shown in the following code sample.
| Xamarin SfPopupLayout |
.NET MAUI SfPopup |
<ContentPage xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms">
<sfPopup:SfPopupLayout x:Name="popupLayout">
<sfPopup:SfPopupLayout.Content>
<Button x:Name="clickToShowPopup" Text="ClickToShowPopup"
VerticalOptions="Start" HorizontalOptions="FillAndExpand"
Clicked="ClickToShowPopup_Clicked"/>
</sfPopup:SfPopupLayout.Content>
</sfPopup:SfPopupLayout>
</ContentPage>
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void ClickToShowPopup_Clicked(object sender, EventArgs e)
{
popupLayout.Show();
}
}
|
<ContentPage xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Popup;assembly=Syncfusion.Maui.Popup">
<ContentPage.Content>
<StackLayout>
<Button x:Name="clickToShowPopup" Text="ClickToShowPopup"
VerticalOptions="Start" HorizontalOptions="Fill"
Clicked="ClickToShowPopup_Clicked"/>
<syncfusion:SfPopup x:Name="popup"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
using Syncfusion.Maui.Popup;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void ClickToShowPopup_Clicked(object sender, EventArgs e)
{
popup.Show();
}
}
|
Classes
| Xamarin SfPopupLayout |
.NET MAUI SfPopup |
Description |
| SfPopupLayout |
SfPopup |
Displays an alert message with customizable buttons or loads a desired view within a popup window. |
| PopupView |
Nil |
Not supported |
Properties
All the properties from the Xamarin.Forms PopupView class are moved to the .NET MAUI SfPopup class itself.
Enums
Upcoming Features
- Popup position -
ShowAtTouchPoint(): A new method to display the popup at the point where the user touched the screen.