locked
Set ConverterParameter in Code RRS feed

  • Question

  • Is it possible to set the Binding's ConverterParameter to a string value in code?  I have the Visibility property set to a Converter, which return true if the value is equal to the parameter.  Since it isn't possible to databind the ConverterParameter, I am trying to set its value in the Constructor.

     

    XAML:

    <Grid x:Name="mainGrid" Visibility="{Binding Section, Converter={StaticResource sectionVisConverter}, ConverterParameter=SectionName}">
     
    Friday, March 26, 2010 12:18 PM

Answers

  • you can assign parameter in code behind like this : Binding B = new Binding(); B.ConverterParameter = "your object" tell me if that help !
    Friday, March 26, 2010 2:43 PM