How to apply the styles in .NET MAUI Popup (SfPopup)?
In .NET MAUI Popup, you can enhance the appearance of 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
<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>
You can achieve below output:
Conclusion
I hope you enjoyed learning about 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 anddocumentation, and how to quickly get started for configuration specifications. You can also 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!