using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Aurora.Frontend.Components.HorizontalList;
namespace Aurora.Frontend.Components.MemberList
{
public partial class MemberList : ContentView
{
public MemberList()
{
InitializeComponent();
}
///
/// Bindable property for members list.
///
///
///
///
public static readonly BindableProperty MembersProperty =
BindableProperty.Create(propertyName: "Members",
returnType: typeof(IEnumerable),
declaringType: typeof(MemberList),
defaultBindingMode: BindingMode.Default,
propertyChanged: OnMembersChanged);
///
/// Backing property for MembersProperty
///
///
public IEnumerable Members
{
get
{
return (IEnumerable)GetValue(MembersProperty);
}
set
{
SetValue(MembersProperty, value);
}
}
///
/// Memberes changed event handler. Assign member list source.
///
///
///
///
private static void OnMembersChanged(BindableObject bindable, object oldValue, object newValue)
{
var control = (MemberList)bindable;
var membersList = control.FindByName("MembersHorizontalList") as HorizontalList.HorizontalList;
if (membersList != null)
{
membersList.ItemsSource = newValue as IEnumerable;
}
}
}
}