private async void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            AbMediaContent media = e.Item as AbMediaContent;

            // If clicked media is a card open card page
            if (media.mediaType == MediaContentType.Card)
            {
                Card card = FSManager.getCard(media.name);
                await Navigation.PushAsync(new CardPage(card));

                return;
            }

            // If clicked media is media box toggle
            if (media.mediaType == MediaContentType.MediaCount)
            {
                MediaCountBox mediaBox = media as MediaCountBox;
                mediaBox.toggleOpen();
                return;
            }

            if (card != null)
            {
                // TODO temp this should just have the card's media
                await Navigation.PushAsync(new CardMediaCarouselPage(media, MediaManager.allMedia));
            }
            else
            {
                await Navigation.PushAsync(new CardMediaCarouselPage(media, MediaManager.allMedia));
            }
        }
        private async void flowListView_FlowItemTapped(object sender, ItemTappedEventArgs e)
        {
            AbMediaContent media = e.Item as AbMediaContent;

            if (media.mediaType == MediaContentType.MediaCount)
            {
                MediaCountBox mediaBox = media as MediaCountBox;
                mediaBox.toggleOpen();
            }
            else
            {
                mediaSelectPageOpen = true;
                bool mediaPrevSelected = media.isSelected;

                // Use wait handle so code only runs after MediaSelectPage disappears
                MediaSelectPage selectPage = new MediaSelectPage(media);
                EventWaitHandle waitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);

                selectPage.Disappearing += (s, v) =>
                {
                    waitHandle.Set();
                };

                await Navigation.PushAsync(selectPage);

                await Task.Run(() => waitHandle.WaitOne());

                if (media.isSelected != mediaPrevSelected)
                {
                    toggleLinkMedia(media);
                    await Navigation.PopAsync();
                }
            }
        }
Beispiel #3
0
        private void FlowListView_FlowItemTapped(object sender, ItemTappedEventArgs e)
        {
            if (IsVisible)
            {
                AbMediaContent media = e.Item as AbMediaContent;

                if (media.mediaType == MediaContentType.MediaCount)
                {
                    MediaCountBox mediaBox = media as MediaCountBox;
                    mediaBox.toggleOpen();
                }
                else
                {
                    selectMedia(media);
                }
            }
        }
        // TODO perhaps move behavior to DayMediaObservableCollection
        private async void flowListView_FlowItemTapped(object sender, ItemTappedEventArgs e)
        {
            AbMediaContent media = e.Item as AbMediaContent;

            if (!isSelecting)
            {
                if (media.mediaType == MediaContentType.MediaCount)
                {
                    MediaCountBox mediaBox = media as MediaCountBox;
                    mediaBox.toggleOpen();
                }
                else // NOTE: reusing CardMediaCarouselPage will break disappear logic in MediaDisplayView
                {
                    await Navigation.PushAsync(new CardMediaCarouselPage(media, MediaManager.allMedia));
                }
            }
        }