Multibinding在XAML资源 [英] Multibinding as resource in XAML

查看:90
本文介绍了Multibinding在XAML资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能(如果是如何),添加的 multivaluebinding 前pression资源化。

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

我有一个多值约束,这需要2个独立的结合,和变频器参数的约束之一。

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

我要使用这个绑定5个不同的项目,而这些标签绑定仅在变频器参数不同。其余一切都是一样的。

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

我会避免multibinding样板标签的重复。

I would to avoid repetition of multibinding boilerplate tags.

推荐答案

看到如果事情的工作简单的方法:TRY IT

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>

正常工作。

这篇关于Multibinding在XAML资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆