Exemplo n.º 1
0
        private async void ItemsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.CurrentSelection.Count == 0)
            {
                return;
            }
            if (!(e.CurrentSelection.First() is OrdemServico item))
            {
                return;
            }


            if (sender is CollectionView lv)
            {
                lv.SelectedItem = null;
            }

            //this is required in order to pass the views to animate
            SharedTransitionShell.SetTransitionSelectedGroup(this, item.Id.ToString());

            //await   Navigation.PushAsync(new ItemDetailPage(new ItemDetailViewModel(item)));
            // await Navigation.PushAsync(new ItemDetailPage2());
            // Manually deselect item.
            ItemsListView.SelectedItem = null;
        }
Exemplo n.º 2
0
        async void OnItemSelected(object sender, EventArgs args)
        {
            var layout = (BindableObject)sender;



            var item = (Apartment)layout.BindingContext;

            SharedTransitionShell.SetTransitionSelectedGroup(this, item.Name);

            var other = new Apartment
            {
                Adresse = item.Adresse,
                Id      = item.Id,
                Name    = item.Name
            };
            var newPage = new SetApartmentPage(other);

            try
            {
                newPage.LoadData();
                newPage.BindingContext = newPage;
                await Shell.Current.Navigation.PushAsync(newPage);
            }
            catch (Exception ex)
            {
                await DisplayAlert(string.Empty, ex.Message, AppResources.Ok);
            }
        }
Exemplo n.º 3
0
        private async void PhotoTapped(object sender, EventArgs e)
        {
            var item = (sender as View).BindingContext as Photo;

            var photosPage = new DetailPhotosPage();

            photosPage.Photos = this.Photos;

            var index = Photos.IndexOf(item);

            photosPage.SelectedIndex  = index == -1 ? 0 : index;
            photosPage.PhotosToDelete = PhotosToDelete;
            photosPage.BindingContext = photosPage;
            SharedTransitionShell.SetTransitionSelectedGroup(this, item.PhotoUrl);

            await Shell.Current.Navigation.PushAsync(photosPage);
        }