Skip to content

Instantly share code, notes, and snippets.

@zimmerrol
Created August 30, 2018 07:08
Show Gist options
  • Save zimmerrol/992d22c4c137492d41a85620c90fda43 to your computer and use it in GitHub Desktop.
Save zimmerrol/992d22c4c137492d41a85620c90fda43 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:vm="clr-namespace:SMSIP2.ViewModels;"
xmlns:conv="clr-namespace:SMSIP2.Converters"
x:Class="SMSIP2.CourseListPage"
Title="{Binding Title}"
xmlns:helpers="clr-namespace:SMSIP2.Core.Helpers;assembly=SMSIP2.Core"
x:Name="BrowseItemsPage">
<ContentPage.Content>
<StackLayout>
<ListView x:Name="ItemsListView"
ItemsSource="{Binding Items}"
VerticalOptions="FillAndExpand"
HasUnevenRows="true"
RefreshCommand="{Binding LoadItemsCommand}"
IsPullToRefreshEnabled="true"
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
CachingStrategy="RecycleElement">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.ContextActions>
<MenuItem Clicked="DeleteCourse" CommandParameter="{Binding }"
Text="Delete" Icon="delete_inverse.png" />
</ViewCell.ContextActions>
<Grid Padding="15,8,15,8">
<Grid.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1" Tapped="Item_Tapped"/>
</Grid.GestureRecognizers>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0">
<Label Text="{Binding Title}" LineBreakMode="NoWrap" Style="{DynamicResource ListItemTextStyle}" FontSize="16"
TextColor="{Binding SynchronizationMode, Converter={StaticResource SynchronizationModeColorConverter}}"/>
<Label Text="{Binding TotalFilesCount, Converter={StaticResource ItemNumberConverter}, ConverterParameter=file|files}"
LineBreakMode="NoWrap" Style="{DynamicResource ListItemDetailTextStyle}" FontSize="13" />
</StackLayout>
<Image Grid.Column="1" IsVisible="{Binding IsDownloaded, Converter={StaticResource InverseBooleanConverter}}" Source="download_cloud.png" WidthRequest="32" HeightRequest="32">
<Image.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1" Command="{Binding SynchronizeItemCommand}"/>
</Image.GestureRecognizers>
</Image>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment