【发布时间】:2018-07-14 01:45:05
【问题描述】:
我对扩展 UIPickerViewModel 的类有疑问。
我有一个字符串可以从选择器视图中访问选定的值。即public string SelectedValue {get; set;}。然后在我的类中使用 ViewDidLoad() 方法,我将选择器视图上的模型设置为该类的新实例。
当用户选择值并单击完成按钮时,我想访问他们选择的值并关闭选择器视图,如下所示:
private void GalaxyDoneClicked()
{
this.galaxyTextField.Text = this.galaxyPicker.Model.SelectedValue;
}
但我收到错误消息:UIPickerViewModel does not contain a definition for 'SelectedValue' and no extension method 'SelectedValue' accepting a first argument of type 'UIPickerViewModel' could be found ( are you missing a using directive or an assembly reference?)。
我是 C# 和 Xamarin 的新手,非常欢迎这里的任何帮助。
【问题讨论】:
标签: c# xamarin xamarin.ios