[UWP]管道值转换器 [英] [UWP] Piping Value Converters

查看:56
本文介绍了[UWP]管道值转换器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找创建一个绑定到两个属性并找到此链接的ValueConverter ..

I'm looking to create a ValueConverter that binds to two properties and found this link..

https://www.codeproject.com/articles/15061/ pipe-value-converters-in-wpf

https://www.codeproject.com/articles/15061/piping-value-converters-in-wpf

我无法转换与ValueConversionAttribute相关的行,因为UWP中缺少这些行。

I'm having trouble converting the lines relating to ValueConversionAttribute as it's missing from UWP.

任何想法如何在UWP中使用它(或者如果有更新的解决方案)?

Any ideas how to use this in UWP (or if there is a more current solution)?

推荐答案

Hello
theresonlyonefinmaf

Rob已回复了同样的问题
thread

Rob has replied the same question on this thread:

" UWP应用程序不是WPF,不使用WPF类或命名空间。 ValueConverterAttribute是WPF的System.Windows.Data命名空间的一部分,并且是特定于WPF的(我不相信它在Silverlight中是原生的)。 UWP Xaml应用程序使用Windows.UI.Xaml.Data
命名空间,该命名空间没有此属性,并且与类似的WPF命名空间有其他差异。有关UWP值转换器的信息,请参阅https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Data.IValueConverter。"

"UWP apps are not WPF and don't use WPF classes or namespaces. ValueConverterAttribute is part of WPF's System.Windows.Data namespace and is WPF specific (I don't believe it was natively available in Silverlight). UWP Xaml apps use the Windows.UI.Xaml.Data namespace, which does not have this attribute and has other differences from the similar WPF namespace. See https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Data.IValueConverter for info on UWP value converters."

所以你可能需要遵循现有规则来编辑转换器的类型,而不是考虑用于WPF的此管道。

So you may need to follow the exist rule to edit your converter for the types instead of thinking about this Piping which is for WPF.

祝你好运,

Barry


这篇关于[UWP]管道值转换器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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