The Boolean
[ValueConversion(typeof(int), typeof(bool))]
[ValueConversion(typeof(int?), typeof(bool))]
[ValueConversion(typeof(System.Enum), typeof(bool))]
[ValueConversion(typeof(bool?), typeof(bool))]
[ValueConversion(typeof(char), typeof(bool))]
[ValueConversion(typeof(char?), typeof(bool))]
public class BooleanConverter : IValueConverter
Public Class BooleanConverter
Implements IValueConverter
Introduced: 16.0.
The following XAML example shows how to bind radio buttons to the Input
?
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
?
<Window.Resources>
<tx:BooleanConverter x:Key="boolConv" />
</Window.Resources>
?
<RadioButton
Content="{Binding ElementName=textControl1, Path=InputFormat.NumberFormats[0]}"
GroupName="numberFormat"
IsChecked="{Binding
ElementName=textControl1,
Path=InputFormat.NumberedListFormat,
Converter={StaticResource boolConv},
ConverterParameter=ArabicNumbers}" />
<RadioButton
Content="{Binding ElementName=textControl1, Path=InputFormat.NumberFormats[1]}"
GroupName="numberFormat"
IsChecked="{Binding
ElementName=textControl1,
Path=InputFormat.NumberedListFormat,
Converter={StaticResource boolConv},
ConverterParameter=Letters}" />
?
Method | Description |
---|---|
Convert | Converts a value to a boolean. |
Convert |
Converts a boolean to a value of the type specified through the target |