Odeh.Wpf.UnitsConverters 1.0.4

dotnet add package Odeh.Wpf.UnitsConverters --version 1.0.4
NuGet\Install-Package Odeh.Wpf.UnitsConverters -Version 1.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Odeh.Wpf.UnitsConverters" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Odeh.Wpf.UnitsConverters --version 1.0.4
#r "nuget: Odeh.Wpf.UnitsConverters, 1.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Odeh.Wpf.UnitsConverters as a Cake Addin
#addin nuget:?package=Odeh.Wpf.UnitsConverters&version=1.0.4

// Install Odeh.Wpf.UnitsConverters as a Cake Tool
#tool nuget:?package=Odeh.Wpf.UnitsConverters&version=1.0.4

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.4 114 1/26/2024
1.0.2 87 1/18/2024
1.0.1 140 12/19/2023
1.0.0 108 12/15/2023