Reorganization
This commit is contained in:
24
Aurora/Design/Components/MemberList/MemberList.xaml
Normal file
24
Aurora/Design/Components/MemberList/MemberList.xaml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ContentView
|
||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:hl="clr-namespace:Aurora.Design.Components.HorizontalList"
|
||||
x:Class="Aurora.Design.Components.MemberList.MemberList">
|
||||
<ContentView.Content>
|
||||
<StackLayout>
|
||||
<hl:HorizontalList
|
||||
x:Name="MembersHorizontalList"
|
||||
ListOrientation="Horizontal"
|
||||
VerticalOptions="Start">
|
||||
<hl:HorizontalList.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Frame>
|
||||
<Label
|
||||
Text="{Binding .}"/>
|
||||
</Frame>
|
||||
</DataTemplate>
|
||||
</hl:HorizontalList.ItemTemplate>
|
||||
</hl:HorizontalList>
|
||||
</StackLayout>
|
||||
</ContentView.Content>
|
||||
</ContentView>
|
61
Aurora/Design/Components/MemberList/MemberList.xaml.cs
Normal file
61
Aurora/Design/Components/MemberList/MemberList.xaml.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Forms;
|
||||
using Aurora.Design.Components.HorizontalList;
|
||||
|
||||
namespace Aurora.Design.Components.MemberList
|
||||
{
|
||||
public partial class MemberList : ContentView
|
||||
{
|
||||
public MemberList()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bindable property for members list.
|
||||
/// </summary>
|
||||
/// <param name=""Members""></param>
|
||||
/// <param name="typeof(IEnumerable<string>"></param>
|
||||
/// <returns></returns>
|
||||
public static readonly BindableProperty MembersProperty =
|
||||
BindableProperty.Create(propertyName: "Members",
|
||||
returnType: typeof(IEnumerable<string>),
|
||||
declaringType: typeof(MemberList),
|
||||
defaultBindingMode: BindingMode.Default,
|
||||
propertyChanged: OnMembersChanged);
|
||||
|
||||
/// <summary>
|
||||
/// Backing property for MembersProperty
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public IEnumerable<string> Members
|
||||
{
|
||||
get
|
||||
{
|
||||
return (IEnumerable<string>)GetValue(MembersProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
SetValue(MembersProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Memberes changed event handler. Assign member list source.
|
||||
/// </summary>
|
||||
/// <param name="bindable"></param>
|
||||
/// <param name="oldValue"></param>
|
||||
/// <param name="newValue"></param>
|
||||
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<string>;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user