Skip to content

Commit 204b6e1

Browse files
author
roubachof
committed
chore: new release
1 parent 198a197 commit 204b6e1

File tree

2 files changed

+67
-7
lines changed

2 files changed

+67
-7
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Release Notes v2.0.2
2+
3+
## 🐛 Windows Content Margin Fix
4+
5+
**Type:** Bugfix
6+
7+
This release fixes a critical layout issue on Windows (WinUI) where MAUI margin properties were not being applied to content views within the Shadows handler.
8+
9+
## 🐛 Issue
10+
11+
In the Windows platform implementation, content views (such as `Border` or `Frame` with `Margin` set) were added directly to the native Grid without their MAUI layout properties being transferred to the platform view. This caused all content to render without spacing, ignoring margin values.
12+
13+
```xaml
14+
<!-- This margin was being ignored on Windows -->
15+
<sho:Shadows CornerRadius="10">
16+
<Border Margin="10" Background="White">
17+
<Label Text="Content" />
18+
</Border>
19+
</sho:Shadows>
20+
```
21+
22+
## ✅ Fix
23+
24+
The Windows `ShadowsHandler` now explicitly transfers the MAUI content's `Margin` property to the native WinUI `FrameworkElement`:
25+
26+
```csharp
27+
// Manually apply MAUI margin to the platform view
28+
var contentMargin = shadowsView.Content.Margin;
29+
_contentPlatformView.Margin = new Thickness(
30+
contentMargin.Left,
31+
contentMargin.Top,
32+
contentMargin.Right,
33+
contentMargin.Bottom);
34+
```
35+
36+
This ensures proper spacing and layout behavior consistent with other platforms.
37+
38+
## 📝 Technical Details
39+
40+
- Modified: `Maui.Shadows/Platforms/Windows/ShadowsHandler.cs`
41+
- Added explicit margin transfer from MAUI view to WinUI platform view
42+
- No changes to other platforms (Android, iOS, MacCatalyst remain unchanged)
43+
44+
## 📦 Installation
45+
46+
```bash
47+
dotnet add package Sharpnado.Maui.Shadows --version 2.0.2
48+
```
49+
50+
## 🔄 Migration from 2.0.1
51+
52+
Simply update the package version. No code changes required. Windows layouts with content margins will now render correctly.
53+
54+
## 📚 Documentation
55+
56+
- Main README: https://github.com/roubachof/Sharpnado.Shadows
57+
- Repository: https://github.com/roubachof/Sharpnado.Shadows
58+
59+
## 🙏 Credits
60+
61+
Thanks to the community for reporting this Windows layout issue.

Maui.Shadows/Maui.Shadows.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
2424
<LangVersion>latest</LangVersion>
2525

26-
<Version>2.0.1</Version>
26+
<Version>2.0.2</Version>
2727
<Authors>Jean-Marie Alfonsi</Authors>
2828
<Description>Sharpnado.Maui.Shadows adds high-quality, customizable drop shadows to any .NET MAUI view on Android, iOS, Windows, and MacCatalyst. Define multiple shades per view with Color, Opacity, BlurRadius, and Offset, and match corners with CornerRadius for pixel-perfect results. Android supports a selectable blur algorithm via BlurType (Gpu or StackBlur). Built on modern MAUI handlers with platform-optimized implementations (RenderEffect/RenderScript on Android, CALayer on iOS/MacCatalyst, WinUI 3 Composition on Windows), weak events to prevent leaks, and global bitmap caching for performance. Includes XAML markup extensions (SingleShade, ImmutableShades, ShadeStack, NeumorphismShades) for concise, reusable definitions.</Description>
2929
<PackageProjectUrl>https://github.com/roubachof/Sharpnado.Shadows</PackageProjectUrl>
@@ -38,13 +38,12 @@
3838
<IncludeSymbols>true</IncludeSymbols>
3939
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
4040
<PackageReleaseNotes>
41-
Version 2.0.1 - Windows Platform Inclusion
41+
Version 2.0.2 - Windows Content Margin Fix
4242

43-
PACKAGING FIX:
44-
* Re-release to include Windows platform binaries (net9.0-windows10.0.19041.0)
45-
* Previous 2.0.0 release was missing Windows support due to being packaged on macOS
46-
47-
No code changes from v2.0.0.
43+
BUGFIX:
44+
* Fixed Windows (WinUI) platform: Content margin property is now properly applied
45+
* Handler now manually transfers MAUI margin to native platform view
46+
* Resolves issue where Border/Frame margins were ignored in WinUI Grid layout
4847

4948
See documentation: https://github.com/roubachof/Sharpnado.Shadows
5049
</PackageReleaseNotes>

0 commit comments

Comments
 (0)