Skip to content

Commit 1fb7a7f

Browse files
authored
README: Add link to sample WPF app
1 parent e4f5688 commit 1fb7a7f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ double centimeters = UnitConverter.ConvertByName(5, "Length", "Meter", "Centimet
140140
double centimeters2 = UnitConverter.ConvertByAbbreviation(5, "Length", "m", "cm"); // 500
141141
```
142142

143+
### Example: WPF app using IValueConverter to parse quantities from input
144+
145+
Src: [Samples/WpfMVVMSample](https://github.com/angularsen/UnitsNet/tree/master/Samples/WpfMVVMSample)
146+
147+
![image](https://user-images.githubusercontent.com/787816/34913360-b6690a4e-f8fa-11e7-87ce-ad76fbe28557.png)
148+
149+
The purpose of this app is to show how to create an `IValueConverter` in order to bind XAML to quantities.
150+
151+
NOTE: A lot of reflection and complexity was introduced due to not having a base type. See #371 for discussion on adding base types.
152+
143153
### <a name="precision"></a>Precision and Accuracy
144154

145155
A base unit is chosen for each unit class, represented by a double value (64-bit), and all conversions go via this unit. This means there will always be a small error in both representing other units than the base unit as well as converting between units.

0 commit comments

Comments
 (0)