-
Notifications
You must be signed in to change notification settings - Fork 441
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
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>
- by Property
<?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
redwolf2