Articles in this section
Category / Section

How to disable fade animation of Overlay container in .NET MAUI Popup(SfPopup)?

2 mins read

To disable the fade animation for the overlay alone in a .NET MAUI Popup, set the opacity of the overlay container to “1” during the popup animation. This can be achieved by wiring the PropertyChanged event during the popup’s Opening event.

Public MainPage()
{
    sfPopup = new SfPopup() { AnimationMode = PopupAnimationMode.SlideOnRight,     AnimationDuration = 1000 };
    sfPopup.Opening += OnSfPopupOpening;
}

private void OnSfPopupOpening(object? sender, System.ComponentModel.CancelEventArgs e)
{
     var propertyInfo = sfPopup.GetType().GetField("PopupOverlayContainer", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
     popupOverlayView = propertyInfo.GetValue(sfPopup) as View;
     popupOverlayView.PropertyChanged += OnOverlayPropertyChanged;

} 

private void OnOverlayPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if(e.PropertyName == "Opacity")
     {
         popupOverlayView.Opacity = 1;
     }
 }

Output:

disable_overlay_fade_animation.gif

Download the complete sample from GitHub.

Conclusion
I hope you enjoyed learning about how to disable the fade animation of the overlay alone in the .NET MAUI Popup.

You can refer to our .NET MAUI Popup feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications.

Explore our .NET MAUI Popup example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our other controls.

Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied