Xamarin XAML Binding Path with children

101 Views Asked by At

I have a ViewCell with a Picker which is in ListView:

(Simplified)

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

The ViewCell is bound to a Company which has a collection of Employees (Employee.Name is the field value to show)

How do I set the Picker to the Employees. Bascially I need a this.Employeess ??

1

There are 1 best solutions below

0
On BEST ANSWER

The Since the list of Employees is part of the Company that is being Binded, you simple need to Bind the ItemsSource to the Employees

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