Skip to content

Instantly share code, notes, and snippets.

@danielkon96
Created September 20, 2019 21:50
Show Gist options
  • Save danielkon96/80b196f4092397e04e313eb78eb4e83a to your computer and use it in GitHub Desktop.
Save danielkon96/80b196f4092397e04e313eb78eb4e83a to your computer and use it in GitHub Desktop.
The frontend UI
<?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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:CV="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions"
xmlns:FFImage="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:FFImageCache="clr-namespace:FFImageLoading.Cache;assembly=FFImageLoading"
mc:Ignorable="d"
x:Class="MultiImagePicker.ImageSelectionPage">
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="CarouselViewStyle" TargetType="CV:CarouselViewControl">
<Setter Property="ShowIndicators" Value="True" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="AnimateTransition" Value="False" />
</Style>
<OnPlatform x:Key="cacheType" x:TypeArguments="FFImageCache:CacheType"
iOS="All"
Android="Memory"/>
<OnPlatform x:Key="downsampleWidth" x:TypeArguments="x:Double"
iOS="576"
Android="896"/>
<OnPlatform x:Key="imageHeight" x:TypeArguments="x:Double"
iOS="275"
Android="325"/>
<Style x:Key="CarouselViewPictureStyle" TargetType="FFImage:CachedImage">
<Setter Property="Source" Value="{Binding .}" />
<Setter Property="IsOpaque" Value="True" />
<Setter Property="InputTransparent" Value="False" />
<Setter Property="CacheType" Value="{StaticResource cacheType}" />
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="DownsampleWidth" Value="{StaticResource downsampleWidth}" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout>
<Label Text="Select Photos Page"
HorizontalOptions="CenterAndExpand"
TextColor="Black"
FontSize="Large"
FontAttributes="Bold" />
<StackLayout>
<Button Text="Select Images"
Clicked="SelectImagesButton_Clicked"></Button>
</StackLayout>
<!-- The CarouselView inside of a StackLayout. -->
<StackLayout Margin="0,0,0,20" >
<CV:CarouselViewControl x:Name="ImgCarouselView" Style="{StaticResource CarouselViewStyle}" HeightRequest="{StaticResource imageHeight}">
<CV:CarouselViewControl.ItemTemplate>
<DataTemplate>
<FFImage:CachedImage Style="{StaticResource CarouselViewPictureStyle}"/>
</DataTemplate>
</CV:CarouselViewControl.ItemTemplate>
</CV:CarouselViewControl>
</StackLayout>
<Button Text="Upload Images"
Clicked="UploadImagesButton_Clicked"></Button>
<!-- InfoText is optional. -->
<Label x:Name="InfoText"
IsVisible="False"
Text="Ready for Upload"
HorizontalOptions="CenterAndExpand"
TextColor="Black"
FontSize="Large"
FontAttributes="Bold" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment