is it possible to add a Binding to a ConverterParameter in a MultiBinding? Something like this:
<HierarchicalDataTemplate DataType="{x:Type Elements:RootElement}">
<HierarchicalDataTemplate.ItemsSource>
<MultiBinding Converter="{StaticResource filterConverter}" ConverterParameter="{Binding IsFilterd}">
<Binding Path="Children"/>
<Binding Path="FilterChildren"/>
</MultiBinding>
</HierarchicalDataTemplate.ItemsSource>
<TextBlock Text="{Binding Name}" FontWeight="Normal"/>
</HierarchicalDataTemplate>
Where IsFiltered is a Property on the Object that the Template is applied on. I always get an XAML parser error that the Binding is not correct/allowed in ConverterParameter... Or is there some other way to do this??
Greets,
Jürgen
ConverterParameter is not a DependencyProperty, and therefore databinding can't work on it.
Why not add another Binding to the MultiBinding? send the IsFiltered as another value:
<MultiBinding Converter="{StaticResource filterConverter}" >
<Binding Path="Children"/>
<Binding Path="FilterChildren"/>
<Binding Path="IsFiltered" />
</MultiBinding>
Just add the ConverterParameter the way I did it in the code below, if you have plain text to pass to the multiconverter.
<MultiBinding Converter="{StaticResource SortingDirectionImageMultiConverter}">
<Binding Path="SortingColumnIdentifier"/>
<Binding Path="IsSortingAscending"/>
<MultiBinding.ConverterParameter>txtBlockConfigNumber</MultiBinding.ConverterParameter>
</MultiBinding>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With