AppDimens.Net.Percent
3.6.0
dotnet add package AppDimens.Net.Percent --version 3.6.0
NuGet\Install-Package AppDimens.Net.Percent -Version 3.6.0
<PackageReference Include="AppDimens.Net.Percent" Version="3.6.0" />
<PackageVersion Include="AppDimens.Net.Percent" Version="3.6.0" />
<PackageReference Include="AppDimens.Net.Percent" />
paket add AppDimens.Net.Percent --version 3.6.0
#r "nuget: AppDimens.Net.Percent, 3.6.0"
#:package AppDimens.Net.Percent@3.6.0
#addin nuget:?package=AppDimens.Net.Percent&version=3.6.0
#tool nuget:?package=AppDimens.Net.Percent&version=3.6.0
<div align="center">
📏 AppDimens.Net.Percent
Percentage-of-screen scaling (PSdp, SpaceW) — dimensions that grow exactly with the screen.
Part of the AppDimens for .NET family · requires AppDimens.Net (core).
</div>
🎯 What is it?
The Percent strategy treats your base value as a percentage of a screen dimension
(smallest-width, height or width). 24.PSdp() renders as 24% of the smallest-width axis,
so proportions stay identical on a 5" phone and a 13" tablet — ideal for hero cards,
charts, split layouts and anything that must occupy a relative area.
Also ships the Space helpers (SpaceW, SpaceH, SpaceSw) for computing
free space and gaps directly.
📦 Installation
dotnet add package AppDimens.Net.Percent
Depends on AppDimens.Net (pulled automatically). Attach a MAUI window first (
AppDimensMaui.AttachWindow) or pass an explicitIAppDimensContext— see the core README.
🚀 Quick start
using AppDimens.Net.Percent;
// 30% of the smallest-width axis
float cardWidth = 30.PSdp();
// 25% of the height axis, aspect-ratio adjusted
float heroHeight = 25.PHdpa();
// free space between two fixed elements (in %)
float gap = 5.SpaceW(ctx);
🧭 API
Strategy lanes (prefix PS, PH, PW)
| Extension | Result |
|---|---|
v.PSdp(ctx) · v.PSdpa(ctx) |
% of smallest-width (± aspect ratio) |
v.PHdp(ctx) · v.PWdp(ctx) |
% of height / width axis |
…i variants (PSdpi…) |
ignore multi-window constraints |
v.PSdpPx(ctx) … |
pixel result |
v.PSdpCustom(qualifier, inverter, imw, ar, k) |
full control |
DimenPercent.PSdp(context, value) |
static form |
v.ToPercentDp(v, ctx, …) |
generic kernel entry |
Space helpers
| Extension | Meaning |
|---|---|
v.SpaceW(ctx) · v.SpaceH(ctx) · v.SpaceSw(ctx) |
v as % of width / height / smallest-width |
v.SpaceWi(ctx) … i variants |
multi-window ignored |
v.SpaceWDp(ctx) · v.SpaceHDp(ctx) · v.SpaceSwDp(ctx) |
dp-rounded forms |
v.SpaceDp(v, referenceDp) |
% against an arbitrary reference |
v.SpaceWSp(ctx) |
text-size (sp) variant |
💡 When to use
| Scenario | Recommendation |
|---|---|
| Cards/panels occupying a screen fraction | ✅ Percent |
| Fixed paddings that scale moderately | Scaled (AppDimens.Net core) |
| Text auto-fit | Resize |
⚡ Performance
Same engine as the core: snapshot-partitioned cache, allocation-free fast lanes, automatic invalidation on configuration changes.
📚 Full package family
AppDimens.Net · Auto · Logarithmic · Fluid · Interpolated · Diagonal · Perimeter · Power · Fill · Fit · Density · Resize · Units · Maui · Sdk meta-package
Apache-2.0 — © Jean Bodenberg · Repository · Formulas are bit-a-bit ports of appdimens-kmp
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AppDimens.Net (>= 3.6.0)
-
net8.0
- AppDimens.Net (>= 3.6.0)
-
net9.0
- AppDimens.Net (>= 3.6.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on AppDimens.Net.Percent:
| Package | Downloads |
|---|---|
|
AppDimens.Net.Maui
AppDimens .NET — .NET MAUI integration: live window scopes, event-driven resize watcher, XAML markup extensions and converters. |
|
|
AppDimens.Net.Sdk
AppDimens .NET meta-package ("BOM"): pulls the principal library plus every strategy module with a single reference. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.0 | 115 | 8/23/2026 |