带有子项的Xamarin XAML绑定路径

时间:2018-09-27 20:16:14

标签: xaml xamarin xamarin.forms xamarin.forms.listview

我有一个ViewCell,其中一个PickerListView中:

(简体)

    <ViewCell.View>
        <Label Text="{Binding CompanyName}"/>
        <Picker ItemsSource="{Binding ??this??.Employees}"> 

ViewCell绑定到具有Company集合的EmployeesEmployee.Name是要显示的字段值)

如何将选择器设置为员工。基本上,我需要一个this.Employeess ??

1 个答案:

答案 0 :(得分:1)

由于员工列表是要绑定的公司的一部分,因此您只需要将ItemsSource绑定到员工

  <ViewCell.View>
        <Label Text="{Binding CompanyName}"/>
        <Picker ItemsSource="{Binding Employees}">