This commit is contained in:
Paul Schneider 2016-10-26 20:29:46 +02:00
commit ca1e89a818
14 changed files with 399 additions and 171 deletions

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="BookAStar.Views.UserListView"
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
xmlns:extensions="clr-namespace:BookAStar.Extensions;assembly=BookAStar">
<ContentView.Resources>
<ResourceDictionary>
<Style TargetType="Label">
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
</Style>
<Style TargetType="Button">
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
</Style>
</ResourceDictionary>
</ContentView.Resources>
<ContentView.Content>
<ListView x:Name="list" ItemTapped="OnViewDetail" HasUnevenRows="true" RowHeight="80">
<ListView.ItemTemplate HeightRequest="80" VerticalOptions="StartAndExpand">
<DataTemplate>
<ViewCell>
<ViewCell.View>
<StackLayout Orientation="Horizontal" Padding="10,10,10,10" VerticalOptions="StartAndExpand">
<Image Source="{Binding AvatarOrNot}" Aspect="AspectFit" />
<Label Text="{Binding UserName}" />
<Label Text="{Binding EMail}" />
</StackLayout>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentView.Content>
</ContentView>

View file

@ -0,0 +1,37 @@
using BookAStar.Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace BookAStar.Views
{
public partial class UserListView : ContentView
{
public BindableProperty ItemsSourceProperty = BindableProperty.Create(
"ItemsSource", typeof(IEnumerable), typeof(UserListView));
public IEnumerable ItemsSource
{
get { return list.ItemsSource; }
set { list.ItemsSource = value; }
}
/* public IEnumerable ItemsSource
{
get { return GetValue(ItemsSourceProperty) as IEnumerable; }
set { SetValue(ItemsSourceProperty, value); }
}
*/
public UserListView()
{
InitializeComponent();
}
}
}