Sunday, December 1, 2013

Binding and "converterparameter"

Hi,


I have a class called Graph and it has dependency properties - "Value" and "MaxRange". I have written one converter class and my target is to send "Value" as a value and "MaxRange" as parameter to the Convert() method to compare.


In the DataTrigger using binding I can send "Value" as a value but I am not sure how to send "MaxRange" as a parameter using "converterparameter"..


Is there any way to achieve this??


Here is a xaml code -



<Style TargetType="{x:Type Input:Graph}">
<Setter Property="Width" Value="20.000"/>
<Setter Property="Height" Value="115.500"/>
<Setter Property="Template" Value="{StaticResource WithinRange_ControlTemplate}"/>
<Style.Resources>
<Input:RangeConverter x:Key="RangeConverter"/>
</Style.Resources>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Value, RelativeSource={RelativeSource Self}, Converter={StaticResource RangeConverter}, ConverterParameter=??????}" Value="true">
<Setter Property="Template" Value="{StaticResource BelowRange_ControlTempalte}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

Thanks in Advance,


Prasad.



No comments:

Post a Comment