Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Last active December 14, 2020 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebeam7/9539f7847e2807f4c24a3d75d7a2ab8d to your computer and use it in GitHub Desktop.
Save icebeam7/9539f7847e2807f4c24a3d75d7a2ab8d to your computer and use it in GitHub Desktop.
Views/AnalisisImagenView.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ICTalkMobileApp.Views.AnalisisImagenView"
xmlns:vm="clr-namespace:ICTalkMobileApp.ViewModels">
<ContentPage.BindingContext>
<vm:AnalisisImagenViewModel/>
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout Margin="10" Padding="10" Spacing="10">
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Button Command="{Binding ComandoSeleccionarFoto}"
Text="Seleccionar foto"
BackgroundColor="DarkGreen"
TextColor="White"
CornerRadius="15"/>
<Button Command="{Binding ComandoTomarFoto}"
Text="Tomar foto"
BackgroundColor="DarkGreen"
TextColor="White"
CornerRadius="15"/>
</StackLayout>
<Image Source="{Binding RutaImagen}"
WidthRequest="250"
HeightRequest="250" />
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Button Command="{Binding ComandoSubirImagen}"
Text="Subir imagen"
BackgroundColor="Orange"
TextColor="White"
CornerRadius="15"/>
<Button Command="{Binding ComandoObtenerSimilares}"
Text="Obtener similares"
BackgroundColor="Orange"
TextColor="White"
CornerRadius="15"/>
</StackLayout>
<CarouselView ItemsSource="{Binding ImagenesSimilares}"
PeekAreaInsets="20">
<CarouselView.ItemTemplate>
<DataTemplate>
<Grid RowSpacing="0"
WidthRequest="150"
Padding="5"
Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0"
Source="{Binding Nombre}"
Aspect="AspectFill"/>
<Label Grid.Row="1"
TextColor="Blue"
Text="{Binding Descripcion}" />
<Label Grid.Row="2"
TextColor="Green"
Text="{Binding Tags}" />
</Grid>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment