Skip to content

Instantly share code, notes, and snippets.

@icebeam7

icebeam7/AnalisisImagenView.xaml Secret

Last active Dec 14, 2020
Embed
What would you like to do?
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