c# - 如何在 MVVMcross iOS 上使用反向可见性绑定(bind)?

标签 c# ios xamarin mvvmcross

我正在努力实现:

我希望我的按钮仅在 Bytes 为空时可见,即在我拍照之前。

我尝试了以下方法:

set.Bind (btnTakePhoto).For("Visibility").To(x => x.Bytes).WithConversion("InvertedVisibility");

set.Bind (btnTakePhoto).For("InvertedVisibility").To(x => x.Bytes).WithConversion("InvertedVisibility");

set.Bind (btnTakePhoto).For("InvertedVisibility").To(x => x.Bytes).WithConversion("Visibility");

和一些其他变体。

最佳答案

正确的做法是

set.Bind (btnTakePhoto)
.For("Visibility")
.To(x => x.Bytes)
.WithConversion("InvertedVisibility");

关于c# - 如何在 MVVMcross iOS 上使用反向可见性绑定(bind)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36693305/

相关文章:

xaml - 如何在 Xamarin.Forms 中连接字符串?

Xamarin.Android:如何链接静态库?

c# - 如何让 Elmah 与 UnobservedTaskException 一起工作

C# MySQL id 列无法正常工作

c# - klout api 总是返回未授权

ios - 改变约束时 `self.view.layoutIfNeeded()`做什么

c# - 可以用 C# 中的用户输入计算年龄,但不知道为什么会这样

ios - 具有不确定数量的 UIImageViews 的 UITableViewCell

objective-c - AVPlayerLayer 获取图像到 UIImageView 缓冲区

Android 垃圾收集器 Nursery Full