【问题标题】:Xamarin XAML Binding Path with childrenXamarin XAML 绑定路径与孩子
【发布时间】:2019-03-03 19:29:59
【问题描述】:

我有一个ViewCell 和一个Picker,它位于ListView

(简体)

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

ViewCell 绑定到一个Company,它有一个Employees 的集合(Employee.Name 是要显示的字段值)

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

【问题讨论】:

  • 你试过“{Binding Employees}”吗?

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


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2017-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-28
    • 2017-12-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多