Beispiel #1
0
        private async void AddToLibraryMenu_Click(object sender, RoutedEventArgs e)
        {
            MenuFlyoutItem item = sender as MenuFlyoutItem;

            if (item != null)
            {
                entryToEdit = item.DataContext as SearchResponseEntry;
            }

            var flyout = RootGrid.Resources["AddToLibraryFlyout"] as Flyout;

            var listViewItem = ResultsListView.ContainerFromItem(entryToEdit) as GridViewItem;

            if (flyout != null)
            {
                var editor = ((FrameworkElement)flyout.Content).FindDescendantByName("AddToMyPodcastsEditor") as AddToMyPodcasts;

                WaitRingManager.IsWaitRingVisible = true;
                var podcast = await Podcast.ParseAsync(entryToEdit.feedUrl, false);

                WaitRingManager.IsWaitRingVisible = false;

                if (podcast != null)
                {
                    editor?.SetPodcast(podcast);
                    flyout.ShowAt(listViewItem);
                }
            }
        }
        private ListViewItem SwitchToItemState(object dataContext, DataTemplate template, bool forceUpdate)
        {
            if (forceUpdate)
            {
                ResultsListView.UpdateLayout();
            }
            var item = ResultsListView.ContainerFromItem(dataContext) as ListViewItem;

            if (item != null)
            {
                item.ContentTemplate = template;
            }
            return(item);
        }