AppDimens.Net.Fit
3.6.0
dotnet add package AppDimens.Net.Fit --version 3.6.0
NuGet\Install-Package AppDimens.Net.Fit -Version 3.6.0
<PackageReference Include="AppDimens.Net.Fit" Version="3.6.0" />
<PackageVersion Include="AppDimens.Net.Fit" Version="3.6.0" />
<PackageReference Include="AppDimens.Net.Fit" />
paket add AppDimens.Net.Fit --version 3.6.0
#r "nuget: AppDimens.Net.Fit, 3.6.0"
#:package AppDimens.Net.Fit@3.6.0
#addin nuget:?package=AppDimens.Net.Fit&version=3.6.0
#tool nuget:?package=AppDimens.Net.Fit&version=3.6.0
<div align="center">
🎛️ AppDimens.Net.Fit
The DimenFit builder — priority-driven per-screen overrides resolved in one call.
Part of the AppDimens for .NET family · requires AppDimens.Net (core).
</div>
🎯 What is it?
Fit is the declarative sibling of the Scaled strategy: declare a base value plus any
number of conditional .Screen(...) entries (qualifier, orientation, UI mode) and let the
builder pick the winner using a deterministic priority chain — no nested ifs anywhere.
📦 Installation
dotnet add package AppDimens.Net.Fit
Depends on AppDimens.Net (pulled automatically). Attach a MAUI window first or pass an explicit
IAppDimensContext.
🚀 Quick start
using AppDimens.Net.Fit;
float size = 18.FitScaledDp() // base = 18 dp
.ApplyAspectRatio()
.Screen(DpQualifier.SmallWidth, 600f, 26f) // ≥600 sw → 26
.Screen(Orientation.Landscape, 22f) // landscape → 22
.Screen(UiModeType.Foldable, 30f) // foldable → 30
.Ftsdp(); // resolve (smallest-width)
// also available: .Fthdp() (height) · .Ftwdp() (width) · .Px(...)
Priority resolution:
qualifier+orientation → mode-only → qualifier-only → orientation-only → base value.
🧭 API
Builder — DimenFit
| Member | Purpose |
|---|---|
DimenFit.Create(baseDp) / value.FitScaledDp() |
start a definition |
.Screen(qualifier, threshold, customValue) |
qualifier entry (e.g. sw ≥ 600) |
.Screen(orientation, customValue) |
orientation entry |
.Screen(uiModeType, customValue) |
UI-mode entry (foldables…) |
.Screen(uiModeType, orientation, customValue…) |
combined entries (highest priority) |
.ApplyAspectRatio(bool) · .IgnoreMultiWindows(bool) · .CustomSensitivity(k) |
modifiers |
.Ftsdp() / .Fthdp() / .Ftwdp() / .Px(...) |
resolve against ambient context |
.Resolve(ctx, defaultQualifier) |
explicit-context resolution |
Kernel
float v = baseValue.ToFitDp(context, qualifier, inverter, ignoreMultiWindows, applyAspectRatio, k);
💡 When to use
| Scenario | Recommendation |
|---|---|
| Multiple device-specific overrides | ✅ Fit builder |
| Continuous curves without breakpoints | Fluid |
| Inline single-condition checks | core facilitators (SdpQualifier, SdpRotate) |
⚡ Performance
Same engine as the core: snapshot-partitioned cache, allocation-free fast lanes, automatic invalidation on configuration changes.
📚 Full package family
AppDimens.Net · Percent · Power · Auto · Logarithmic · Fluid · Interpolated · Diagonal · Perimeter · Fill · 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 (1)
Showing the top 1 NuGet packages that depend on AppDimens.Net.Fit:
| Package | Downloads |
|---|---|
|
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 | 94 | 8/23/2026 |