Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
365
Parameter for ValueToTextConverter
posted

With regular ValueConverters I can pass a parameter like this:

<TextBlock Text="{Binding Birthday,Converter={StaticResource dateconverter},ConverterParameter='dd-MMM-yyyy'}" ></TextBlock>

The XamDateTimeEditor has properties like ValueToTextConverter and ValueToDisplayTextConverter.

How would I go about passing parameters to these converters?

Parents
  • 17559
    Verified Answer
    posted

    Hello tbremeyer,

     

    I reviewed your issue and I believe that when you use the ValueToTextConverter or the ValueToDisplayTextConverter you don’t need explicitly to provide a converter parameter. When you set the resource for the converter like this:

                <igEditors:XamDateTimeEditor.ValueToTextConverter>

                    <local:dateconverter />

                </igEditors:XamDateTimeEditor.ValueToTextConverter>

    where "dateconverter" is custom IValueConverter, by default as value of the Convert method is provided the value of the XamDateTimeEditor and as parameter is assigned the whole XamDateTimeEditor. So I believe that in your case you can set

     

    <igEditors:XamDateTimeEditor Value=”{Binding Birthday}” Format=”dd-MMM-yyy”>

     

     and in your custom converter you can get this value:

     

    XamDateTimeEditor editor = parameter as XamDateTimeEditor;

     MyParameter= editor.Format;

     

    For further reference you can check the following link form our documentation:

    http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=InfragisticsWPF4.Editors.v10.3~Infragistics.Windows.Editors.ValueEditor~ValueToTextConverter.html

     

    If you need any further assistance on the matter, please feel free to ask.

Reply Children
No Data