How to apply the styles in .NET MAUI Popup (SfPopup)?
In .NET MAUI Popup, you can enhance the appearance of the SfPopup control using implicit styling. Implicit styling allows you to define a style for a specific control type, and all instances of that type within a particular scope will automatically adopt the defined style.
XAML
Here’s how you can apply implicit styling to SfPopup in your .NET MAUI application:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiPopup"
xmlns:syncLayout="clr-namespace:Syncfusion.Maui.Popup;assembly=Syncfusion.Maui.Popup"
x:Class="MauiPopup.MainPage">
<ContentPage.Resources>
<Style TargetType="syncLayout:SfPopup">
<Setter Property="PopupStyle">
<Setter.Value>
<syncLayout:PopupStyle
CornerRadius="0"
HeaderBackground="LightCyan"
FooterBackground="LightCyan"
AcceptButtonBackground ="Green"
AcceptButtonTextColor="White"
DeclineButtonBackground="Red"
DeclineButtonTextColor="White"
/>
</Setter.Value>
</Setter>
</Style>
</ContentPage.Resources>
<StackLayout>
<Button Text="Click to Show Popup" x:Name="showPopupButton"/>
<syncLayout:SfPopup x:Name="popUpLayout"
ShowHeader="True"
ShowFooter="True"
AppearanceMode="TwoButton">
</syncLayout:SfPopup>
</StackLayout>
</ContentPage>
Output
Download the complete sample on GitHub
Conclusion
I hope you enjoyed learning how to style popup-view using implicit styling in .NET MAUI SfPopup.
You can refer to our.NET MAUI SfPopup feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. Explore our .NET MAUI SfPopup example to understand how to create and present data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!