Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
Margin and Padding are not applied to Popup in the Style attribute.
Property, the value is applied.
Expected Behavior
Margin and Padding are applied in the Style attribute as well as in the property.
Steps To Reproduce
- Create a Style to be applied to the Popup and set Padding and Margin.
- Apply Style to Popup
by Style
<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup
x:Class="Popup2App.NoBorderPropertyPopup"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Style="{StaticResource NoBorderPopup}"
WidthRequest="200">
<toolkit:Popup.Resources>
<ResourceDictionary>
<Style x:Key="NoBorderPopup" TargetType="toolkit:Popup">
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
<Setter Property="BackgroundColor" Value="Blue" />
</Style>
</ResourceDictionary>
</toolkit:Popup.Resources>
<VerticalStackLayout>
<Button Clicked="OnCloseClick" Text="Close" />
</VerticalStackLayout>
</toolkit:Popup>

<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup
x:Class="Popup2App.NoBorderStylePopup"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Margin="0"
Padding="0"
BackgroundColor="Blue"
WidthRequest="200">
<VerticalStackLayout>
<Button Clicked="OnCloseClick" Text="Close" />
</VerticalStackLayout>
</toolkit:Popup>

Link to public reproduction project repository
https://github.com/usausa/Issue-CommunityToolkitMaui-Popup2
Environment
- .NET MAUI CommunityToolkit: 12.0.0
- OS: Android
- .NET MAUI: 9.0.80
Anything else?
No response
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
Margin and Padding are not applied to Popup in the Style attribute.
Property, the value is applied.
Expected Behavior
Margin and Padding are applied in the Style attribute as well as in the property.
Steps To Reproduce
by Style
Link to public reproduction project repository
https://github.com/usausa/Issue-CommunityToolkitMaui-Popup2
Environment
Anything else?
No response