Odeh.Wpf.UnitsConverters
1.0.5
dotnet add package Odeh.Wpf.UnitsConverters --version 1.0.5
NuGet\Install-Package Odeh.Wpf.UnitsConverters -Version 1.0.5
<PackageReference Include="Odeh.Wpf.UnitsConverters" Version="1.0.5" />
paket add Odeh.Wpf.UnitsConverters --version 1.0.5
#r "nuget: Odeh.Wpf.UnitsConverters, 1.0.5"
// Install Odeh.Wpf.UnitsConverters as a Cake Addin #addin nuget:?package=Odeh.Wpf.UnitsConverters&version=1.0.5 // Install Odeh.Wpf.UnitsConverters as a Cake Tool #tool nuget:?package=Odeh.Wpf.UnitsConverters&version=1.0.5
Odeh WPF UnitsConverters
A collection of IValueConverters for basic physical units conversion in WPF controls.
Simple expression evaluation in a TextBox is provided via NCalc dependency.
Examples
<units:LengthConverter x:Key="LengthFtConverter" DisplayUnit="ft" />
<units:LengthConverter x:Key="LengthFractionConverter" DisplayUnit="fractional" />
<units:LengthConverter x:Key="LengthInConverter" DisplayUnit="in" />
<units:AreaConverter x:Key="AreaSqFtConverter" DisplayUnit="ft²" />
<units:AreaConverter x:Key="AreaSqInConverter" DisplayUnit="in²" />
<units:PressureConverter x:Key="PressurePsfConverter" DisplayUnit="psf" />
<units:PressureConverter x:Key="PressureKsiConverter" DisplayUnit="ksi" />
<units:TimeConverter x:Key="TimeSecondsConverter" DisplayUnit="s" />
<units:PressureConverter x:Key="PressurePsiConverter" DisplayUnit="psi" />
<units:ForceConverter x:Key="ForceKipConverter" DisplayUnit="kip" />
<units:ForceConverter x:Key="ForceLbsConverter" DisplayUnit="lbs" />
<units:ForcePerVolumeConverter x:Key="ForcePerVolumePcfConverter" DisplayUnit="pcf" />
<units:MomentConverter x:Key="MomentLbsFtConverter" DisplayUnit="lbs-ft" />
<units:MomentConverter x:Key="MomentKipFtConverter" DisplayUnit="kip-ft" />
<units:ForcePerLengthConverter x:Key="ForcePerLengthPlfConverter" DisplayUnit="plf" />
<units:ForcePerLengthConverter x:Key="ForcePerLengthKipInConverter" DisplayUnit="kip/in" />
<units:SpeedConverter x:Key="SpeedMphConverter" DisplayUnit="mph" />
Docs
All converters (except CalculatedExpressionCoverter) have a DisplayUnit property, which defines which units to convert to when displaying the value in the control. This is also the default unit assumed when no unit is provided by the user when editing a value.
LengthConverter accepts a special DisplayUnit static string LenghtConverter.Fractional to display the value in fractional feet and inches for imperial units.
The values are saved in imperial units (Force = kip, Lenght = in, Time = s) on ConvertBack.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. |
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- CoreCLR-NCalc (>= 2.2.113)
-
net6.0-windows7.0
- CoreCLR-NCalc (>= 2.2.113)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|