Search Results for

    Show / Hide Table of Contents

    Class BoolToStringConverter

    Implementation of IValueConverter that converts a Boolean to a custom string representation e.g., convert true to "Enabled".

    Inheritance
    Object
    DispatcherObject
    DependencyObject
    BoolToStringConverter
    Implements
    IValueConverter
    Inherited Members
    DependencyObject.ClearValue(DependencyProperty)
    DependencyObject.ClearValue(DependencyPropertyKey)
    DependencyObject.CoerceValue(DependencyProperty)
    DependencyObject.Equals(Object)
    DependencyObject.GetHashCode()
    DependencyObject.GetLocalValueEnumerator()
    DependencyObject.GetValue(DependencyProperty)
    DependencyObject.InvalidateProperty(DependencyProperty)
    DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs)
    DependencyObject.ReadLocalValue(DependencyProperty)
    DependencyObject.SetCurrentValue(DependencyProperty, Object)
    DependencyObject.SetValue(DependencyProperty, Object)
    DependencyObject.SetValue(DependencyPropertyKey, Object)
    DependencyObject.ShouldSerializeProperty(DependencyProperty)
    DependencyObject.DependencyObjectType
    DependencyObject.IsSealed
    DispatcherObject.Dispatcher
    Object.Equals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: BionicCode.Utilities.Net
    Assembly: BionicCode.Utilities.Net.Wpf.dll
    Syntax
    [ValueConversion(typeof(bool), typeof(string))]
    public class BoolToStringConverter : DependencyObject, IValueConverter
    Examples
    <ToggleButton IsChecked="{Binding IsEnabled}">
      <ToggleButton.Content>
        <Binding Path="IsEnabled">
          <Binding.Converter>
            <BoolToStringConverter TrueValue="On" FalseValue="{Binding DisabledText}" NullValue="Undefined" />
          </Binding.Converter>
        </Binding>
      </ToggleButton.Content>
    </ToggleButton>

    Fields

    | Improve this Doc View Source

    FalseValueProperty

    The DependencyProperty of the FalseValue property.

    Declaration
    public static readonly DependencyProperty FalseValueProperty
    Field Value
    Type Description
    DependencyProperty
    | Improve this Doc View Source

    NullValueProperty

    The DependencyProperty of the NullValue property.

    Declaration
    public static readonly DependencyProperty NullValueProperty
    Field Value
    Type Description
    DependencyProperty
    | Improve this Doc View Source

    TrueValueProperty

    The DependencyProperty of the TrueValue property.

    Declaration
    public static readonly DependencyProperty TrueValueProperty
    Field Value
    Type Description
    DependencyProperty

    Properties

    | Improve this Doc View Source

    FalseValue

    The value to show in case the converter input evaluates to false.

    Declaration
    public string FalseValue { get; set; }
    Property Value
    Type Description
    String

    A string representation of Boolean that evaluates to false.

    | Improve this Doc View Source

    NullValue

    The value to show in case the converter input evaluates to true.

    Declaration
    public string NullValue { get; set; }
    Property Value
    Type Description
    String

    A string representation of Nullable that evaluates to null.

    | Improve this Doc View Source

    TrueValue

    The value to show in case the converter input evaluates to true.

    Declaration
    public string TrueValue { get; set; }
    Property Value
    Type Description
    String

    A string representation of Boolean that evaluates to true.

    Methods

    | Improve this Doc View Source

    Convert(Object, Type, Object, CultureInfo)

    Declaration
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    Parameters
    Type Name Description
    Object value
    Type targetType
    Object parameter
    CultureInfo culture
    Returns
    Type Description
    Object
    | Improve this Doc View Source

    ConvertBack(Object, Type, Object, CultureInfo)

    Declaration
    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    Parameters
    Type Name Description
    Object value
    Type targetType
    Object parameter
    CultureInfo culture
    Returns
    Type Description
    Object

    Implements

    IValueConverter

    Extension Methods

    HelperExtensionsCommon.ToDictionary(Object)
    HelperExtensionsCommon.ToFlatDictionary(Object)
    HelperExtensions.TryFindVisualParentElement<TParent>(DependencyObject, out TParent)
    HelperExtensions.TryFindVisualParentElementByName<TChild>(DependencyObject, String, out TChild)
    HelperExtensions.TryFindVisualChildElement<TChild>(DependencyObject, out TChild)
    HelperExtensions.TryFindVisualChildElementByName<TChild>(DependencyObject, String, out TChild)
    HelperExtensions.EnumerateVisualChildElements<TChildren>(DependencyObject)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX