WPF 中有内置的 IMultiValueConverts 吗?

发布于 2024-08-22 07:47:18 字数 254 浏览 5 评论 0 原文

我正在编写一个包含两个绑定的 MultiBinding - 每个绑定返回一个布尔值。使用 MultiBindings 您需要指定一个 IMultiValueConverter。在我的例子中,这个转换器应该接受两个布尔值并返回它们的AND。写起来确实很简单,但是我必须这样做吗?这感觉就像是最基本的 MultiValueConverter,如果 .NET 中已经有一个现有的,我不想编写一个。

那么——有吗?如果是这样 - 有哪些内置 IMultiValueConverters?

I'm writing a MultiBinding containing two bindings - each returning a bool. Using MultiBindings you need to specify an IMultiValueConverter. In my case this converter should take two bools and return the AND of them. This is really simple to write, but do I have to? This feels like the most basic MultiValueConverter, and I don't want to write one if there is already an existing one in .NET.

So - is there? And if so - which built in IMultiValueConverters are there?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哀由 2024-08-29 07:47:18

我的脑海里没有任何直接适合你的东西。 Reflector 表示那里只有三个打开的​​ IMultiValueConverter:

这个答案是无用的。但也许您会在 Kent Boogaart 的 WPF 转换器 库中找到一些有用的东西。

干杯,安瓦卡。

Nothing comes into my mind that will suit you directly. Reflector says there are only three open IMultiValueConverters there:

This answer is useless. But maybe you'll find something helpful among Kent Boogaart's WPF converters library.

Cheers, Anvaka.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文