【发布时间】:2020-04-20 20:07:56
【问题描述】:
我在我的代码隐藏中创建了几个编辑器,我想将它们的 TextProperty 绑定到数组中的对象字符串。对象在 ViewModel 中声明。
后面的代码:
Editor text = new Editor();
text.SetBinding(Editor.TextProperty, "Here one string from string array in an object");
对象
public VObject {
public string[] strings;
}
视图模型:
public VObject CurrentObject {
get { return _currentObject; }
set
{
_currentObject = value;
OnPropertyChanged();
}
}
提前感谢您的帮助
【问题讨论】:
标签: mvvm xamarin.forms data-binding