SilverlightShow: Tip: How to pass a parameter to a value converter? Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) RE: Tip: How to pass a parameter to a value converter? <div class="commentText"> <p>Hello!</p> <p> The only thing that I can come up with is to set the fraction 1/3 as a string "1/3" to the ConverterParameter. After that in the converter you can easily parse the string to the desired double value. Hope that helps!</p> <p>Greets!</p> </div> http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx#comment5053 Enrai http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx Fri, 10 Dec 2010 15:58:55 GMT RE: Tip: How to pass a parameter to a value converter? this is cool. Now pass me please the value "1/3" as double parameter ;) http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx#comment5051 serhio http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx Fri, 10 Dec 2010 15:35:52 GMT RE: Tip: How to pass a parameter to a value converter? Awesome! Couldn't find how to programmatically bind and convert anywhere else... thank you! http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx#comment3571 wpf noob http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx Mon, 10 May 2010 19:06:48 GMT RE: Tip: How to pass a parameter to a value converter? You could modify converter to expect not simple type as a value but well known for the converter interface. Interface could give all info needed for converter. In this case you don't need to bind converter parameter. See <a href="http://blog.andrew-veresov.com/post/Binding-a-Converter-Parameter.aspx">here</a> for more info. http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx#comment3174 andrew.veresov http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx Fri, 05 Mar 2010 17:35:07 GMT RE: Tip: How to pass a parameter to a value converter? <p>It's still not possible to bind the <strong>ConverterParameter </strong>in Silverlight. But there is a possible workaround:</p> <p>If you have a business object with for example two properties - <strong>Value </strong>and <strong>Parameter</strong>, and you want to bind to the <strong>Value</strong> and pass the <strong>Parameter </strong>to the <strong>ConverterParameter</strong>. The solution is to bind to the entire business object, so in the <strong>Convert() </strong>method of the converter you will have access to both the <strong>Value </strong>and the <strong>Parameter </strong>properties.</p> <p>Hope this helps!</p> <p>Greets,<br /> Martin</p> http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx#comment3172 Enrai http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx Fri, 05 Mar 2010 14:21:23 GMT RE: Tip: How to pass a parameter to a value converter? Hi i need to pass a binding value as a parameter to the converter class.. please help me in sorting this... http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx#comment3171 Jeeva http://www.silverlightshow.net/items/Tip-How-to-pass-a-parameter-to-a-value-converter.aspx Fri, 05 Mar 2010 14:08:28 GMT