B.Balamanigandan February 2016

How to Pass multiple parameter in Multivalue Converter Over WPF DataTrigger

I'm having four int Property ProOne, ProTwo, ProThree and ProFour

I have to Implement the Boolean Logic ((ProOne == ProTwo) || (ProThree == ProFour)) in the Multivalue Converter namely VisibilityCheckConverter. Based on the Logic the Multivalue Converter VisibilityCheckConverter returns True or False.

Now I need to pass the four properties to the Converter over DataTrigger, Based on the Value, I have to change the Buttons Visibility to Visible

Kindly assist me how to write the DataTrigger using Multivalue Converter with multiple parameter

Sample Piece of XAML Code:

    <DataTrigger Property="{Binding , Converter={StaticResource VisibilityCheckConverter,ConverterParameter=ProOne ProTwo ProThree ProFour}}" Value="true">
        <Setter TargetName="Button" Property="Visibility" Value="Visible" />


Nikhil Agrawal February 2016

You can do something like this

    <DataTrigger Value="True">
            <MultiBinding Converter="{StaticResource VisibilityCheckConverter}">
                <Binding Path="ProOne" />
                <Binding Path="ProTwo" />
                <Binding Path="ProThree" />
                <Binding Path="ProFour" />
        <Setter TargetName="Button" Property="Visibility" Value="Visible" />

Post Status

Asked in February 2016
Viewed 1,189 times
Voted 6
Answered 1 times


Leave an answer