Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multibinding as resource in XAML

Is it possible (if yes how), to add multivaluebinding expression into resource.

I have a Multivalue binding, that takes 2 separate binding, and converter parameter in one of those binding.

I have to use this binding to 5 Different items, and those binding tags differ only in converter parameter. Rest everything is same.

I would to avoid repetition of multibinding boilerplate tags.

like image 317
Tilak Avatar asked Feb 05 '13 06:02

Tilak


1 Answers

Easy way of seeing if something works: TRY IT!

    <Style TargetType="Button">
        <Setter Property="Content">
            <Setter.Value>
                <MultiBinding Converter="{StaticResource OmgLolzConverter}">
                    <Binding Path="One" Converter="{StaticResource CakeConverter}"/>
                    <Binding Path="Two" Converter="{StaticResource CakeConverter}"/>
                </MultiBinding>
            </Setter.Value>
        </Setter>
    </Style>

Works fine.

like image 112
Duncan Matheson Avatar answered Oct 20 '22 16:10

Duncan Matheson