Hello community
I set a button in my home, and when I click on in there is a little delay on the transition
Home screen
<StackLayout Padding="30" HorizontalOptions="Center"> <Image Source="Perfil.png" WidthRequest="50" HeightRequest="50" /> <Label Text="{Binding Username}" HorizontalOptions="Center" /> <StackLayout Orientation="Vertical" Spacing="10"> <StackLayout Orientation="Horizontal" HorizontalOptions="Center" Margin="0,0,40,0"> <Button Text="Mis mascotas" ContentLayout="Left,20" Image="Mis_mascotas.png" HorizontalOptions="Start" BackgroundColor="Transparent" /> </StackLayout> <StackLayout Orientation="Horizontal" HorizontalOptions="Center"> <Button Text="Agenda de control" ContentLayout="Left,20" Image="Agenda_control.png" HorizontalOptions="Start" BackgroundColor="Transparent" /> </StackLayout> <StackLayout Orientation="Horizontal" HorizontalOptions="Center"> <Button Text="Pareja encontrada" ContentLayout="Left,20" Image="Pareja_encontrada.png" HorizontalOptions="Start" BackgroundColor="Transparent" /> </StackLayout> <StackLayout Orientation="Horizontal" HorizontalOptions="Center" Margin="0,0,30,0"> <Button Text="Editar mi perfil" Command="{Binding GoToProfile}" ContentLayout="Left,20" Image="Editar.png" HorizontalOptions="Start" BackgroundColor="Transparent" /> </StackLayout> </StackLayout> <StackLayout Margin="0,40,0,0" Spacing="20"> <Image Source="BotonCompra.png" /> <Button BackgroundColor="{StaticResource ThirdColor}" Text="¿Quieres poner a tu mascota en adopción?" CornerRadius="20" TextColor="{StaticResource BtonsColor}" /> <Button BackgroundColor="{StaticResource ThirdColor}" Text="¿Quieres poner a tu mascota disponible en busqueda de parejas?" CornerRadius="20" TextColor="{StaticResource BtonsColor}" /> </StackLayout> </StackLayout> </ContentPage.Content> </ContentPage>
HomeVM
public ICommand GoToProfile { get; set; } public List<Item> HamburgersItems { get; set; } public HomeViewModel() { HamburgersItems = new HamburgerService().GetHamburgerItems(); GoToProfile = new Command(async () => { await Application.Current.MainPage.Navigation.PushAsync(new ProfileScreen()); });
detail
<ContentPage Title="Master" Padding="15"> <StackLayout Orientation="Vertical"> <StackLayout Orientation="Vertical"> <StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand"> <Image Source="avatar.png" BackgroundColor="Transparent" HeightRequest="100" WidthRequest="100" VerticalOptions="Center" /> <StackLayout Orientation="Vertical"> <Label Text="Xamarin" HorizontalTextAlignment="Start" FontSize="Large" Margin="2,0,0,0" HorizontalOptions="Start" VerticalOptions="EndAndExpand" TextColor="Black" /> <Label Text="Xamarin Forms" HorizontalTextAlignment="Start" FontSize="Small" Margin="2,0,0,0" HorizontalOptions="Start" VerticalOptions="StartAndExpand" TextColor="#16161d" /> </StackLayout> </StackLayout> <StackLayout BackgroundColor="Black" MinimumHeightRequest="1" Orientation="Vertical" HeightRequest="1" HorizontalOptions="FillAndExpand"> <Label Text="fff" FontSize="1" TextColor="Black" BackgroundColor="Black" HorizontalOptions="CenterAndExpand" /> </StackLayout> <CollectionView x:Name="MyBurger" SelectionMode="Single" ItemsSource="{Binding HamburgersItems}" SelectedItem="{Binding Item}" SelectionChangedCommand="{Binding SelectedItemChange}"> <CollectionView.ItemTemplate> <DataTemplate> <Grid Margin="10"> <Grid.ColumnDefinitions> <ColumnDefinition Width="auto" /> </Grid.ColumnDefinitions> <StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center"> <Image Source="{Binding ImgSource}" Aspect="AspectFit" WidthRequest="37" HeightRequest="37" /> <Label Text="{Binding Title}" VerticalOptions="Center" HorizontalOptions="Center" Grid.Column="1" /> </StackLayout> </Grid> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView> </StackLayout> </StackLayout> </ContentPage> </MasterDetailPage.Master> <MasterDetailPage.Detail> <NavigationPage BarBackgroundColor="{StaticResource PrimaryColor}"> <x:Arguments> <ContentPage Padding="10"> <NavigationPage.TitleView> <StackLayout Spacing="30" Orientation="Horizontal" VerticalOptions="Center" HorizontalOptions="Center"> <Image Source="LogoTexto.png" Margin="0,0,50,0" WidthRequest="200" /> <Image Source="CampanaNotificaciones.png"> </Image> </StackLayout> </NavigationPage.TitleView> <ContentPage.Content> <ScrollView> <StackLayout> <StackLayout Margin="10,20,0,0" Orientation="Horizontal"> <ImageButton BackgroundColor="Transparent" Source="userPicture.png" HorizontalOptions="CenterAndExpand" WidthRequest="182" HeightRequest="182" /> </StackLayout> <StackLayout Margin="10,30,10,0" Spacing="20"> <Label Text="Nombre del usuario" HorizontalOptions="CenterAndExpand" /> <Entry Placeholder="Nombre" Keyboard="Text" /> <Entry Placeholder="Segundo Nombre" Keyboard="Text" /> <Entry Placeholder="Apellido" Keyboard="Text" /> <Entry Placeholder="Segundo apellido" Keyboard="Text" /> <renders:ExtendedDatePicker /> <Picker Title="Genero" /> <Label Text="Ubicación" Style="{StaticResource SeparatorTextStyle}" /> <Picker Title="Nacionalidad" /> <Entry Placeholder="Documento de identidad" Keyboard="Numeric" /> <Picker Title="Pais" /> <Picker Title="Estado" /> <Picker Title="Ciudad" /> <Entry Placeholder="Dirección" /> <Label Text="Información de contacto" Style="{StaticResource SeparatorTextStyle}" /> <Entry Placeholder="Teléfono local" Keyboard="Telephone" /> <Entry Placeholder="Teléfono Celular" Keyboard="Telephone" /> <Entry Placeholder="Correo eletrónico" Keyboard="Email" /> <Entry Placeholder="Correo eletrónico secundario" Keyboard="Email" /> <Label Text="Acerca de mi" Style="{StaticResource SeparatorTextStyle}" /> <Editor Placeholder="Una breve descripción" AutoSize="TextChanges" Keyboard="Text" /> <Button Text="Guardar" Margin="0,0,0,20" Style="{StaticResource YellowButtons}" HorizontalOptions="Center" /> </StackLayout> </StackLayout> </ScrollView> </ContentPage.Content> </ContentPage> </x:Arguments> </NavigationPage> </MasterDetailPage.Detail> </MasterDetailPage>