您好我有一个使用选择器控件的Xamarin表单应用程序。它绑定到以下列表
public ObservableRangeCollection<MyType> Types { get; set; }
...
public class MyType
{
public string Code { get; set; }
public string Description { get; set; }
public string Status { get; set; }
}
...
public class Contact
{
public string Type{ get; set; }
}
...
<Picker x:Name="TypePicker" Title="Please select a type.."
ItemsSource="{Binding MyType}, Mode=TwoWay}"
ItemDisplayBinding="{Binding Description}"
SelectedItem="{Binding Contact.Type}" />
我想知道如何将选择器控件(Code)的值存储并设置为{Binding Contact.Type} SelectedItem
我见过例子:
https://forums.xamarin.com/discussion/102876/how-to-get-selected-value-from-binding-picker
但是这不会更新与选择器使用的不同类型。