ListView.GroupShortNameBinding 속성

정의

그룹화된 점프 목록에 표시할 이름에 대한 바인딩을 가져오거나 설정합니다.

public Xamarin.Forms.BindingBase GroupShortNameBinding { get; set; }
member this.GroupShortNameBinding : Xamarin.Forms.BindingBase with get, set

속성 값

BindingBase 그룹화된 목록에 적용할 instance 또는 null입니다.

예제

이 예제에서는 짧은 이름 바인딩 집합을 사용하여 첫 번째 이니셜별로 그룹화된 사전순으로 표시된 사용자 목록을 보여줍니다.

class Person
{
  public string FullName
  {
    get;
    set;
  }

  public string Address
  {
    get;
    set;
  }
}
class Group : ObservableCollection<Person>
{
  public Group (string firstInitial)
  {
    FirstInitial = firstInitial;
  }

  public string FirstInitial
  {
    get;
    private set;
  }
}
ListView CreateListView()
{
  var listView = new ListView {
    IsGroupingEnabled = true,
    GroupDisplayBinding = new Binding ("FirstInitial"),
    GroupShortNameBinding = new Binding ("FirstInitial")
  };

  var template = new DataTemplate (typeof (TextCell));
  template.SetBinding (TextCell.TextProperty, "FullName");
  template.SetBinding (TextCell.DetailProperty, "Address");

  itemsView.ItemTemplate = template;
  itemsView.ItemsSource = new[] {
        new Group ("C") {
            new Person { FullName = "Caprice Nave" }
        },

    new Group ("J") {
            new Person { FullName = "James Smith", Address = "404 Nowhere Street" },
            new Person { FullName = "John Doe", Address = "404 Nowhere Ave" }
        }
  };
}

설명

에서 ListView항목을 그룹화할 때 점프 목록을 사용하여 목록의 특정 섹션으로 이동하는 것이 유용한 경우가 많습니다. 예를 들어 사전순으로 그룹화된 목록에서 점프 목록은 각 그룹의 문자가 됩니다. 이 바인딩은 점프 목록에 표시할 짧은 이름을 선택하기 위해 각 그룹의 에 적용 IEnumerable 됩니다.

참고: Android에는 표시된 점프 목록이 없습니다.

적용 대상