寻找具有多个数据绑定点的WPF帮助 [英] Looking for some WPF assistance with multiple data bound points

查看:51
本文介绍了寻找具有多个数据绑定点的WPF帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种获取一个文本块的方法,如果A的值大于0且B的值为0,则文本块应显示A,否则显示B.

I'm looking for a way to take one text block and if the value of A is greater then 0 and the value of B is 0 then the textblock should display A, otherwise display B.

A和B都是数据绑定到此文本块的属性.

A and B are both properties that are databound to this textblock.

任何帮助弄清楚这一点或如何实现的想法都将是很棒的.

Any help figuring this out or an idea of how to accomplish it would be great.

我当时在考虑某种价值转换器,但我正在尽我所能在XAML中做很多事情,而不是在逻辑转换器中填充一吨逻辑

I was thinking some kind of value converter but I'm trying to do as much as I can inside of the XAML instead of filling a converter with a TON of logic

推荐答案

一个非常令人困惑的帖子.

A very confusing post.

A和B绑定到什么?  

What are A and B bound to?  

我建议使用DataTrigger,但XAML触发器只能测试一个值,而不能测试大于另一个的值.  

I would suggest a DataTrigger but XAML triggers can only test for a value not for a value greater than another.  


这篇关于寻找具有多个数据绑定点的WPF帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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