The Measure
[ValueConversion(typeof(int), typeof(string))]
[ValueConversion(typeof(int), typeof(double))]
public class MeasureConverter : IValueConverter
Public Class MeasureConverter
Implements IValueConverter
Introduced: 16.0.
The following XAML example binds the Input
?
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
?
<Window.Resources>
<tx:MeasureConverter Unit="Centimeter" x:Key="twipsConv" />
</Window.Resources>
?
<TextBox
Text="{Binding
ElementName=textControl1,
Path=InputFormat.TopDistance,
Converter={StaticResource twipsConv},
Mode=TwoWay}" />
Method | Description |
---|---|
Convert | Converts a value from twips to another meaasuring unit. |
Convert |
Converts a value from another measuring unit to twips. |
Property | Description |
---|---|
Decimals | Gets or sets the number of decimals for the converted value. |
Show |
Gets or sets a value specifying whether all decimals set with the Decimals property are shown, when the result is a string. |
Unit | Gets or sets the measuring unit for the conversion. |