//Check if item content contains preview image private async Task CheckItemContentContainsPreviewImage(TableItems LoadTable) { try { int ItemImagecount = 0; bool FoundPreviewImage = false; //Check the preview image string ItemImageLink = LoadTable.item_image; if (string.IsNullOrWhiteSpace(ItemImageLink)) { item_image.item_source.Source = null; item_image.Visibility = Visibility.Collapsed; return; } //Check if there are images and the preview image is included CheckTextBlockForPreviewImage(rtb_ItemContent, ItemImageLink, ref ItemImagecount, ref FoundPreviewImage); //Update the preview image based on result if (ItemImagecount == 0 || !FoundPreviewImage) { System.Diagnostics.Debug.WriteLine("No media found in rich text block, adding item image."); //Check if media is a gif(v) file bool ImageIsGif = ItemImageLink.ToLower().Contains(".gif"); //Check if low bandwidth mode is enabled if (ImageIsGif && (bool)AppVariables.ApplicationSettings["LowBandwidthMode"]) { //System.Diagnostics.Debug.WriteLine("Low bandwidth mode skipping gif."); item_image.item_status.Text = "Gif not loaded,\nlow bandwidth mode."; item_image.Visibility = Visibility.Visible; return; } if (ImageIsGif) { item_image.item_video_status.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconVideoPause.png", false); item_image.item_video.Visibility = Visibility.Visible; } item_image.MaxHeight = AppVariables.MaximumItemImageHeight; item_image.item_source.Source = await AVImage.LoadBitmapImage(ItemImageLink, true); item_image.Visibility = Visibility.Visible; } else { item_image.item_source.Source = null; item_image.Visibility = Visibility.Collapsed; } } catch { item_image.item_source.Source = null; item_image.Visibility = Visibility.Collapsed; } }
private async void item_source_Tapped(object sender, TappedRoutedEventArgs e) { try { string ImageLink = string.Empty; if (item_source.Source.GetType() == typeof(BitmapImage)) { BitmapImage bitmapSource = item_source.Source as BitmapImage; ImageLink = bitmapSource.UriSource.ToString(); //Check if media is a gif(v) file if (ImageLink.ToLower().Contains(".gif")) { ToolTipService.SetToolTip(item_video, "Play the video"); item_video_status.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconVideoPlay.png", false); bitmapSource.Stop(); } } else if (item_source.Source.GetType() == typeof(SvgImageSource)) { SvgImageSource SvgSource = item_source.Source as SvgImageSource; ImageLink = SvgSource.UriSource.ToString(); } System.Diagnostics.Debug.WriteLine("Itemviewer image tapped: " + ImageLink); ImagePopup imageViewer = new ImagePopup(); await imageViewer.OpenPopup(ImageLink); } catch { } }
//Update the displayed item content public static async Task ScrollViewerUpdateContent(ListView TargetListView, int CurrentOffsetId) { try { //Get total items count int targetItems = TargetListView.Items.Count(); //Check total items count if (targetItems == 0) { return; } //Update offset to the current position int OffsetIdNegative = CurrentOffsetId - AppVariables.ContentToScrollLoad; int OffsetIdPositive = CurrentOffsetId + AppVariables.ContentToScrollLoad; //Load and clean item content for (int itemIndex = 0; itemIndex < targetItems; itemIndex++) { Items updateItem = TargetListView.Items[itemIndex] as Items; if (itemIndex >= OffsetIdNegative && itemIndex <= OffsetIdPositive) { string ItemImageLink = updateItem.item_image_link; if (updateItem.item_image == null && !string.IsNullOrWhiteSpace(ItemImageLink) && updateItem.item_image_visibility == Visibility.Visible && AppVariables.LoadMedia) { updateItem.item_image = ItemImageLink; } if (updateItem.feed_icon == null) { if (updateItem.feed_id.StartsWith("user/")) { updateItem.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconUser-Dark.png", false); } else { updateItem.feed_icon = await AVImage.LoadBitmapImage("ms-appdata:///local/" + updateItem.feed_id + ".png", false); } if (updateItem.feed_icon == null) { updateItem.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); } } } else { if (updateItem.item_image != null) { updateItem.item_image = null; } if (updateItem.feed_icon != null) { updateItem.feed_icon = null; } } } } catch { } }
private async void propertychanged_item_image(DependencyPropertyChangedEventArgs args) { try { //Check if image is available if (args.NewValue == null) { item_status.Text = "Image is not available,\nopen item in browser to view it."; item_status.Visibility = Visibility.Visible; item_source.Source = null; return; } //Debug.WriteLine("Image source updating..."); BitmapImage BitmapImage = (BitmapImage)args.NewValue; //Check if media is a gif(v) file string ImageLink = BitmapImage.UriSource.ToString(); bool ImageIsGif = ImageLink.ToLower().Contains(".gif"); //Check if low bandwidth mode is enabled if (ImageIsGif && (bool)AppVariables.ApplicationSettings["LowBandwidthMode"]) { item_status.Text = "Gif not loaded,\nlow bandwidth mode."; item_status.Visibility = Visibility.Visible; item_source.Source = null; } else { item_status.Text = "Image loading,\nor is not available."; item_status.Visibility = Visibility.Visible; item_source.Source = BitmapImage; BitmapImage.DownloadProgress += bitmapimage_DownloadProgress; } //Display or hide the video icon if (ImageIsGif) { //Debug.WriteLine("Image is animated visibility updating..."); if (!BitmapImage.AutoPlay) { ToolTipService.SetToolTip(item_video, "Play the video"); item_video_status.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconVideoPlay.png", false); } else { ToolTipService.SetToolTip(item_video, "Pause the video"); item_video_status.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconVideoPause.png", false); } item_video.Visibility = Visibility.Visible; } else { //Debug.WriteLine("Image is static visibility updating..."); item_video.Visibility = Visibility.Collapsed; } } catch { } }
//Open the popup public async Task OpenPopup(string ImageLink) { try { if (PopupIsOpen) { Debug.WriteLine("The popup is already open..."); return; } //Open the popup popup_Main.IsOpen = true; PopupIsOpen = true; //Focus on the popup iconClose.Focus(FocusState.Programmatic); //Adjust the swiping direction SwipeBarAdjust(); //Show the switch fullscreen mode icon if (!AVFunctions.DevMobile()) { iconScreenMode.Visibility = Visibility.Visible; } //Set Landscape Display DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait | DisplayOrientations.Landscape; //Load the image source vBitmapImage = await AVImage.LoadBitmapImage(ImageLink, true); if (vBitmapImage != null) { //Set the image to viewer image_source.Source = vBitmapImage; image_status.Visibility = Visibility.Visible; //Check if media is a gif(v) file bool ImageIsGif = ImageLink.ToLower().Contains(".gif"); if (ImageIsGif) { item_video.Visibility = Visibility.Visible; } } else { image_status.Text = "Image failed to load."; image_source.Source = null; image_status.Visibility = Visibility.Visible; } //Register page events RegisterPageEvents(); } catch { } }
private async Task HideShowHeader(bool ForceClose) { try { if (ForceClose || stackpanel_Header.Visibility == Visibility.Visible) { stackpanel_Header.Visibility = Visibility.Collapsed; await HideShowMenu(true); if (!AVFunctions.DevMobile()) { iconMenu.Margin = new Thickness(0, 0, 16, 0); } image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu-Dark.png", false); image_iconMenu.Opacity = 0.60; image_iconBack.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconBack-Dark.png", false); image_iconBack.Opacity = 0.60; grid_StatusApplication.Margin = new Thickness(0, 0, 0, 0); grid_StatusApplication.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88)) { Opacity = 0.60 }; AppVariables.HeaderHidden = true; } else { stackpanel_Header.Visibility = Visibility.Visible; iconMenu.Margin = new Thickness(0, 0, 0, 0); image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu.png", false); image_iconMenu.Opacity = 1; image_iconBack.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconBack.png", false); image_iconBack.Opacity = 1; grid_StatusApplication.Margin = new Thickness(0, 65, 0, 0); grid_StatusApplication.Background = new SolidColorBrush((Color)Application.Current.Resources["ApplicationAccentLightColor"]) { Opacity = 0.60 }; AppVariables.HeaderHidden = false; } } catch { } }
private async Task DownloadFullItemContent(int RetryCount) { try { //Download the full item content string FullContent = await WebParser(vCurrentWebSource.item_link, false, true); if (!string.IsNullOrWhiteSpace(FullContent)) { //Load item into the viewer await LoadItem(FullContent); //Update the button text button_LoadFullItem.Content = "Load the original item"; ToolTipService.SetToolTip(iconItem, "Load the original item"); iconImageItem.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconItemSumm.png", false); PreviousScrollOffset = -1; //Scroll to the top await Task.Delay(10); scrollviewer_NewsItem.ChangeView(null, 0, null); } else { if (RetryCount == 3) { //Check if internet is available if (NetworkInterface.GetIsNetworkAvailable()) { Debug.WriteLine("There is currently no full item content available."); int MsgBoxResult = await AVMessageBox.Popup("No item content available", "There is currently no full item content available, would you like to open the item in the browser?", "Open in browser", "", "", "", "", true); if (MsgBoxResult == 1) { await OpenBrowser(null, true); } } else { Debug.WriteLine("There is currently no full item content available. (No Internet)"); await AVMessageBox.Popup("No item content available", "There is currently no full item content available but it might also be your internet connection, please check your internet connection and try again.", "Ok", "", "", "", "", false); } } else { RetryCount++; Debug.WriteLine("Retrying to download full item content: " + RetryCount); await DownloadFullItemContent(RetryCount); } } } catch { } }
private async Task SettingsLoad() { try { System.Diagnostics.Debug.WriteLine("Loading application settings..."); //Disable Landscape Display setting_DisableLandscapeDisplay.IsChecked = (bool)AppVariables.ApplicationSettings["DisableLandscapeDisplay"]; //Color Theme setting_ColorTheme.SelectedIndex = Convert.ToInt32(AppVariables.ApplicationSettings["ColorTheme"]); //Item Scroll Direction setting_ItemScrollDirection.SelectedIndex = Convert.ToInt32(AppVariables.ApplicationSettings["ItemScrollDirection"]); //Adjust Font Size int fontSize = Convert.ToInt32(AppVariables.ApplicationSettings["AdjustFontSize"]); textblock_AdjustFontSize.Text = textblock_AdjustFontSize.Tag.ToString() + fontSize; setting_AdjustFontSize.Value = fontSize; //Item list view styles ComboBoxImageList ComboTitleImageText = new ComboBoxImageList(); ComboTitleImageText.Image = await AVImage.LoadBitmapImage("ms-appx:///Assets/ListStyles/0.png", false); ComboTitleImageText.Title = "Title, image and text"; setting_ListViewStyle.Items.Add(ComboTitleImageText); ComboBoxImageList ComboTitleImage = new ComboBoxImageList(); ComboTitleImage.Image = await AVImage.LoadBitmapImage("ms-appx:///Assets/ListStyles/1.png", false); ComboTitleImage.Title = "Title and image"; setting_ListViewStyle.Items.Add(ComboTitleImage); ComboBoxImageList ComboTitleText = new ComboBoxImageList(); ComboTitleText.Image = await AVImage.LoadBitmapImage("ms-appx:///Assets/ListStyles/2.png", false); ComboTitleText.Title = "Title and text"; setting_ListViewStyle.Items.Add(ComboTitleText); ComboBoxImageList ComboTitle = new ComboBoxImageList(); ComboTitle.Image = await AVImage.LoadBitmapImage("ms-appx:///Assets/ListStyles/3.png", false); ComboTitle.Title = "Title only"; setting_ListViewStyle.Items.Add(ComboTitle); //Item list view style setting_ListViewStyle.SelectedIndex = Convert.ToInt32(AppVariables.ApplicationSettings["ListViewStyle"]); } catch { } }
async void iconStar_Tap(object sender, RoutedEventArgs e) { try { await HideShowMenu(true); //Update the status bar if (vCurrentWebSource.item_star_status == Visibility.Collapsed) { ProgressDisableUI("Starring the item..."); } else { ProgressDisableUI("Unstarring the item..."); } //Get and set the current page name string CurrentPageName = App.vApplicationFrame.SourcePageType.ToString(); if (CurrentPageName.EndsWith("StarredPage")) { bool MarkedAsStar = await MarkItemAsStarPrompt(vCurrentWebSource, true, true, false, false, true); //Update the header and selection feeds if (MarkedAsStar) { await EventUpdateTotalItemsCount(null, null, false, true); } } else { await MarkItemAsStarPrompt(vCurrentWebSource, true, false, false, false, true); } //Update the star status if (vCurrentWebSource.item_star_status == Visibility.Collapsed) { ToolTipService.SetToolTip(iconStar, "Star item"); iconImageStar.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconStarAdd.png", false); } else { ToolTipService.SetToolTip(iconStar, "Unstar item"); iconImageStar.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconStarRemove.png", false); } ProgressEnableUI(); } catch { } }
private async Task LoadFullItem() { try { if (button_LoadFullItem.Content.ToString() == "Load the original item") { ProgressDisableUI("Loading the original item..."); //Load the original item content string OriginalContent = vCurrentItem.item_content_full; //Load item into the viewer await LoadItem(OriginalContent); //Update the button text button_LoadFullItem.Content = "Load the full item"; ToolTipService.SetToolTip(iconItem, "Load the full item"); iconImageItem.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconItemFull.png", false); PreviousScrollOffset = -1; //Scroll to the top await Task.Delay(10); scrollviewer_NewsItem.ChangeView(null, 0, null); } else { //Check if internet is available if (AppVariables.InternetAccess) { ProgressDisableUI("Loading the full item..."); int RetryCount = 0; await DownloadFullItemContent(RetryCount); } else { System.Diagnostics.Debug.WriteLine("No network available to fully load this item."); await new MessagePopup().OpenPopup("No internet connection", "You currently don't have an internet connection available to fully load this item.", "Ok", "", "", "", "", false); } } ProgressEnableUI(); } catch { } }
private async void item_video_Click(object sender, RoutedEventArgs e) { try { BitmapImage bitmapSource = item_source.Source as BitmapImage; if (bitmapSource.IsPlaying) { ToolTipService.SetToolTip(item_video, "Play the video"); item_video_status.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconVideoPlay.png", false); bitmapSource.Stop(); } else { ToolTipService.SetToolTip(item_video, "Pause the video"); item_video_status.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconVideoPause.png", false); bitmapSource.Play(); } } catch { } }
private async void item_image_Update(DependencyPropertyChangedEventArgs args) { try { //Check if image is available if (args.NewValue == null) { item_status.Text = "Image is not available,\nopen item in browser to view it."; item_status.Visibility = Visibility.Visible; item_source.Source = null; return; } //Get updated image link string ImageLink = (string)args.NewValue; System.Diagnostics.Debug.WriteLine("Image source updating to: " + ImageLink); //Check the image link if (string.IsNullOrWhiteSpace(ImageLink)) { item_status.Text = "Image link corrupt,\nopen item in browser to view it."; item_status.Visibility = Visibility.Visible; item_source.Source = null; return; } //Check media file type bool ImageIsGif = ImageLink.ToLower().Contains(".gif"); bool ImageIsSvg = ImageLink.ToLower().Contains(".svg"); //Check if low bandwidth mode is enabled if (ImageIsGif && (bool)AppVariables.ApplicationSettings["LowBandwidthMode"]) { item_status.Text = "Gif not loaded,\nlow bandwidth mode."; item_status.Visibility = Visibility.Visible; item_source.Source = null; return; } //Load the image BitmapImage BitmapImage = new BitmapImage(); BitmapImage.UriSource = new Uri(ImageLink); BitmapImage.DownloadProgress += bitmapimage_DownloadProgress; //Set the image item_status.Text = "Image loading,\nor is not available."; item_status.Visibility = Visibility.Visible; item_source.Source = BitmapImage; //Display or hide the video icon if (ImageIsGif) { //System.Diagnostics.Debug.WriteLine("Image is animated visibility updating..."); if (!BitmapImage.AutoPlay) { ToolTipService.SetToolTip(item_video, "Play the video"); item_video_status.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconVideoPlay.png", false); } else { ToolTipService.SetToolTip(item_video, "Pause the video"); item_video_status.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconVideoPause.png", false); } item_video.Visibility = Visibility.Visible; } else { //System.Diagnostics.Debug.WriteLine("Image is static visibility updating..."); item_video.Visibility = Visibility.Collapsed; } } catch { } }
public static async Task <bool> ProcessTableFeedsToList(ObservableCollection <Feeds> AddList, List <TableFeeds> LoadTableFeeds) { try { foreach (TableFeeds Feed in LoadTableFeeds) { //Load and check feed id string FeedId = Feed.feed_id; if (AddList.Any(x => x.feed_id == FeedId)) { continue; } //Check feed status Visibility IgnoreStatus = Feed.feed_ignore_status ? Visibility.Visible : Visibility.Collapsed; //Load feed folder string FeedFolder = Feed.feed_folder; if (string.IsNullOrWhiteSpace(FeedFolder)) { FeedFolder = "No folder"; } //Load feed icon BitmapImage FeedIcon = null; if (FeedId.StartsWith("user/")) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconUser-Dark.png", false); } else { FeedIcon = await AVImage.LoadBitmapImage("ms-appdata:///local/" + FeedId + ".png", false); } if (FeedIcon == null) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); } //Add feed to list AddList.Add(new Feeds() { feed_id = FeedId, feed_title = Feed.feed_title, feed_icon = FeedIcon, feed_link = Feed.feed_link, feed_folder_title = FeedFolder, feed_ignore_status = IgnoreStatus }); } //Update the added item count AppVariables.CurrentFeedsLoaded++; //Request information update if (AppVariables.CurrentFeedsLoaded == 1) { await EventHideProgressionStatus(); } return(true); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Failed processing multiple feeds from database: " + ex.Message); return(false); } }
//Load feeds in selection async Task LoadSelectionFeeds(bool Silent, bool EnableUI) { try { if (!Silent) { await ProgressDisableUI("Loading selection feeds...", true); } System.Diagnostics.Debug.WriteLine("Loading selection feeds, silent: " + Silent); combobox_FeedSelection.IsHitTestVisible = false; combobox_FeedSelection.Opacity = 0.30; await ClearObservableCollection(List_FeedSelect); //Check if received lists are empty List <TableFeeds> LoadTableFeeds = await SQLConnection.Table <TableFeeds>().OrderBy(x => x.feed_folder).ToListAsync(); //Filter un/ignored feeds List <TableFeeds> UnignoredFeedList = LoadTableFeeds.Where(x => x.feed_ignore_status == false).ToList(); //Add all feeds selection Feeds FeedItemAll = new Feeds(); FeedItemAll.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); FeedItemAll.feed_title = "All available items"; FeedItemAll.feed_collection_status = true; FeedItemAll.feed_id = "0"; List_FeedSelect.Add(FeedItemAll); //Feeds that are not ignored and contain items foreach (TableFeeds Feed in UnignoredFeedList) { Feeds TempFeed = new Feeds(); TempFeed.feed_id = Feed.feed_id; //Add folder string FeedFolder = Feed.feed_folder; if (string.IsNullOrWhiteSpace(FeedFolder)) { FeedFolder = "No folder"; } Feeds FolderUpdate = List_FeedSelect.Where(x => x.feed_folder_title == FeedFolder && x.feed_folder_status).FirstOrDefault(); if (FolderUpdate == null) { //Load folder icon BitmapImage FolderIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconFolder-Dark.png", false); //Add folder Feeds FolderItem = new Feeds(); FolderItem.feed_icon = FolderIcon; FolderItem.feed_folder_title = FeedFolder; FolderItem.feed_folder_status = true; List_FeedSelect.Add(FolderItem); //System.Diagnostics.Debug.WriteLine("Added folder..."); } //Add feed //Load feed icon BitmapImage FeedIcon = null; if (Feed.feed_id.StartsWith("user/")) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconUser-Dark.png", false); } else { FeedIcon = await AVImage.LoadBitmapImage("ms-appdata:///local/" + Feed.feed_id + ".png", false); } if (FeedIcon == null) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); } //Get the current feed item count Feeds FeedItem = new Feeds(); FeedItem.feed_icon = FeedIcon; FeedItem.feed_title = Feed.feed_title; FeedItem.feed_id = Feed.feed_id; List_FeedSelect.Add(FeedItem); //Update folder FolderUpdate = List_FeedSelect.Where(x => x.feed_folder_title == FeedFolder && x.feed_folder_status).FirstOrDefault(); if (FolderUpdate != null) { FolderUpdate.feed_folder_ids.Add(Feed.feed_id); FolderUpdate.feed_item_count = FolderUpdate.feed_item_count + FeedItem.feed_item_count; //System.Diagnostics.Debug.WriteLine("Updated folder..."); } } combobox_FeedSelection.SelectedIndex = 0; combobox_FeedSelection.IsHitTestVisible = true; combobox_FeedSelection.Opacity = 1; } catch { } if (EnableUI) { await ProgressEnableUI(); } }
public static async Task <bool> ProcessTableItemsToList(ObservableCollection <Items> AddList, List <TableItems> LoadTableItems, bool AddFromTop, bool HideReadStatus, bool HideStarStatus) { try { //Check if media needs to load AppVariables.LoadMedia = true; if (!NetworkInterface.GetIsNetworkAvailable() && !(bool)AppVariables.ApplicationSettings["DisplayImagesOffline"]) { AppVariables.LoadMedia = false; } //Wait for busy database await ApiUpdate.WaitForBusyDatabase(); List <TableFeeds> FeedList = await SQLConnection.Table <TableFeeds>().ToListAsync(); foreach (TableItems LoadTable in LoadTableItems) { //Load and check item id string ItemId = LoadTable.item_id; if (!AddList.Any(x => x.item_id == ItemId)) { //Load feed id and title string FeedId = LoadTable.item_feed_id; string FeedTitle = "Unknown feed"; TableFeeds TableResult = FeedList.Where(x => x.feed_id == FeedId).FirstOrDefault(); if (TableResult == null) { //Debug.WriteLine("Feed not found: " + FeedId); if (LoadTable.item_feed_title != null && !String.IsNullOrWhiteSpace(LoadTable.item_feed_title)) { Debug.WriteLine("Backup feed title: " + LoadTable.item_feed_title); FeedTitle = LoadTable.item_feed_title; } else if (FeedId.StartsWith("user/")) { Debug.WriteLine("Detected an user feed."); FeedTitle = "User feed"; } } else { //Set the feed item title FeedTitle = TableResult.feed_title; } //Load item image BitmapImage ItemImage = null; Visibility ItemImageVisibility = Visibility.Collapsed; string ItemImageLink = LoadTable.item_image; if (!String.IsNullOrWhiteSpace(ItemImageLink) && AppVariables.LoadMedia) { ItemImageVisibility = Visibility.Visible; if (AppVariables.CurrentItemsLoaded < AppVariables.ContentToScrollLoad) { ItemImage = await AVImage.LoadBitmapImage(ItemImageLink, false); } } //Load feed icon BitmapImage FeedIcon = null; if (AppVariables.CurrentItemsLoaded < AppVariables.ContentToScrollLoad) { if (FeedId.StartsWith("user/")) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconUser-Dark.png", false); } else { FeedIcon = await AVImage.LoadBitmapImage("ms-appdata:///local/" + FeedId + ".png", false); } if (FeedIcon == null) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); } } //Set the date time string DateTime convertedDate = DateTime.SpecifyKind(LoadTable.item_datetime, DateTimeKind.Utc).ToLocalTime(); string DateAuthorString = convertedDate.ToString(AppVariables.CultureInfoFormat.LongDatePattern, AppVariables.CultureInfoFormat) + ", " + convertedDate.ToString(AppVariables.CultureInfoFormat.ShortTimePattern, AppVariables.CultureInfoFormat); //Add the author to date time if ((bool)AppVariables.ApplicationSettings["DisplayItemsAuthor"] && !String.IsNullOrWhiteSpace(LoadTable.item_author)) { DateAuthorString += " by " + LoadTable.item_author; } //Check item read or star status Visibility ReadVisibility = Visibility.Collapsed; if (!HideReadStatus) { ReadVisibility = LoadTable.item_read_status ? Visibility.Visible : Visibility.Collapsed; } Visibility StarredVisibility = Visibility.Collapsed; if (!HideStarStatus) { StarredVisibility = LoadTable.item_star_status ? Visibility.Visible : Visibility.Collapsed; } //Load item content string item_content = String.Empty; if ((bool)AppVariables.ApplicationSettings["ContentCutting"]) { item_content = AVFunctions.StringCut(LoadTable.item_content, Convert.ToInt32(AppVariables.ApplicationSettings["ContentCuttingLength"]), "..."); } else { item_content = AVFunctions.StringCut(LoadTable.item_content, AppVariables.MaximumItemTextLength, "..."); } //Add item to the ListView Items NewItem = new Items() { feed_id = FeedId, feed_title = FeedTitle, feed_icon = FeedIcon, item_id = ItemId, item_read_status = ReadVisibility, item_star_status = StarredVisibility, item_title = LoadTable.item_title, item_image = ItemImage, item_image_visibility = ItemImageVisibility, item_image_link = ItemImageLink, item_content = item_content, item_link = LoadTable.item_link, item_datestring = DateAuthorString, item_datetime = LoadTable.item_datetime }; await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { try { if (AddFromTop) { AddList.Insert(0, NewItem); } else { AddList.Add(NewItem); } } catch { } }); //Update the added item count AppVariables.CurrentItemsLoaded++; //Request information update if (AppVariables.CurrentItemsLoaded == 1) { await EventHideProgressionStatus(); } } } return(true); } catch (Exception ex) { Debug.WriteLine("Failed processing multiple items from database: " + ex.Message); return(false); } }
private async Task HideShowHeader(bool ForceClose) { try { Int32 HeaderTargetSize = Convert.ToInt32(stackpanel_Header.Tag); Int32 HeaderCurrentSize = Convert.ToInt32(stackpanel_Header.Height); if (ForceClose || HeaderCurrentSize == HeaderTargetSize) { AVAnimations.Ani_Height(stackpanel_Header, 0, false, 0.075); await HideShowMenu(true); if (!AVFunctions.DevMobile()) { iconMenu.Margin = new Thickness(0, 0, 16, 0); } image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu-Dark.png", false); image_iconMenu.Opacity = 0.60; grid_StatusApplication.Margin = new Thickness(0, 0, 0, 0); grid_StatusApplication.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88)) { Opacity = 0.60 }; border_StatusCurrentItem.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88)) { Opacity = 0.50 }; //Update the current item status text if (AppVariables.CurrentTotalItemsCount == 0) { textblock_StatusCurrentItem.Text = textblock_StatusCurrentItem.Tag.ToString(); } else { textblock_StatusCurrentItem.Text = textblock_StatusCurrentItem.Tag.ToString() + "/" + AppVariables.CurrentTotalItemsCount; } //Adjust the title bar color await AppAdjust.AdjustTitleBarColor(this.RequestedTheme, false, false); AppVariables.HeaderHidden = true; } else { AVAnimations.Ani_Height(stackpanel_Header, HeaderTargetSize, true, 0.075); iconMenu.Margin = new Thickness(0, 0, 0, 0); image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu.png", false); image_iconMenu.Opacity = 1; grid_StatusApplication.Margin = new Thickness(0, 65, 0, 0); grid_StatusApplication.Background = new SolidColorBrush((Color)Resources["SystemAccentColor"]) { Opacity = 0.60 }; border_StatusCurrentItem.Background = new SolidColorBrush((Color)Resources["SystemAccentColor"]) { Opacity = 0.50 }; //Update the current item status text textblock_StatusCurrentItem.Text = textblock_StatusCurrentItem.Tag.ToString(); //Adjust the title bar color await AppAdjust.AdjustTitleBarColor(this.RequestedTheme, true, false); AppVariables.HeaderHidden = false; } } catch { } }
private async Task HideShowHeader(bool ForceClose) { try { if (ForceClose || stackpanel_Header.Visibility == Visibility.Visible) { stackpanel_Header.Visibility = Visibility.Collapsed; await HideShowMenu(true); if (!AVFunctions.DevMobile()) { iconMenu.Margin = new Thickness(0, 0, 16, 0); } image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu-Dark.png", false); image_iconMenu.Opacity = 0.60; grid_StatusApplication.Margin = new Thickness(0, 0, 0, 0); grid_StatusApplication.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88)) { Opacity = 0.60 }; border_StatusCurrentItem.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88)) { Opacity = 0.50 }; //Update the current item status text if (AppVariables.CurrentTotalItemsCount == 0) { textblock_StatusCurrentItem.Text = AppVariables.CurrentShownItemCount.ToString(); } else { textblock_StatusCurrentItem.Text = AppVariables.CurrentShownItemCount + "/" + AppVariables.CurrentTotalItemsCount; } AppVariables.HeaderHidden = true; } else { stackpanel_Header.Visibility = Visibility.Visible; iconMenu.Margin = new Thickness(0, 0, 0, 0); image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu.png", false); image_iconMenu.Opacity = 1; grid_StatusApplication.Margin = new Thickness(0, 65, 0, 0); grid_StatusApplication.Background = new SolidColorBrush((Color)Application.Current.Resources["ApplicationAccentLightColor"]) { Opacity = 0.60 }; border_StatusCurrentItem.Background = new SolidColorBrush((Color)Application.Current.Resources["ApplicationAccentLightColor"]) { Opacity = 0.50 }; //Update the current item status text textblock_StatusCurrentItem.Text = AppVariables.CurrentShownItemCount.ToString(); AppVariables.HeaderHidden = false; } } catch { } }
private async Task GenerateImage(StackPanel addElement, HtmlNode htmlNode) { try { //Decode the image source link string sourceUri = string.Empty; if (htmlNode.Attributes["src"] != null) { sourceUri = WebUtility.HtmlDecode(htmlNode.Attributes["src"].Value); sourceUri = WebUtility.UrlDecode(sourceUri); } else if (htmlNode.Attributes["srcset"] != null) { sourceUri = WebUtility.HtmlDecode(htmlNode.Attributes["srcset"].Value); sourceUri = WebUtility.UrlDecode(sourceUri); } //Split an image srcset link Regex RegexSourceset = new Regex(@"(?:\s+\d+[wx])(?:,\s+)?"); IEnumerable <string> ImageSources = RegexSourceset.Split(sourceUri).Where(x => x != string.Empty); if (ImageSources.Any()) { sourceUri = ImageSources.LastOrDefault(); } //Split http(s):// tags from uri if (sourceUri.Contains("https://") && sourceUri.LastIndexOf("https://") <= 20) { sourceUri = sourceUri.Substring(sourceUri.LastIndexOf("https://")); } if (sourceUri.Contains("http://") && sourceUri.LastIndexOf("http://") <= 20) { sourceUri = sourceUri.Substring(sourceUri.LastIndexOf("http://")); } //Check if image needs to be blocked if (string.IsNullOrWhiteSpace(sourceUri) || AppVariables.BlockedListUrl.Any(sourceUri.ToLower().Contains)) { System.Diagnostics.Debug.WriteLine("Blocked image: " + sourceUri); return; } //Check if device is low on memory if (AVFunctions.DevMemoryAvailableMB() < 100) { ImageContainer img = new ImageContainer(); img.item_status.Text = "Image not loaded,\ndevice is low on memory."; img.IsHitTestVisible = false; addElement.Children.Add(img); //GenerateBreak(addElement); return; } //Check if media is a gif(v) file bool ImageIsGif = sourceUri.ToLower().Contains(".gif"); bool ImageIsSvg = sourceUri.ToLower().Contains(".svg"); //Check if low bandwidth mode is enabled if (ImageIsGif && (bool)AppVariables.ApplicationSettings["LowBandwidthMode"]) { ImageContainer img = new ImageContainer(); img.item_status.Text = "Gif not loaded,\nlow bandwidth mode."; img.IsHitTestVisible = false; addElement.Children.Add(img); //GenerateBreak(addElement); return; } //Create item image //Fix move image downloading to imagecontainer System.Diagnostics.Debug.WriteLine("Adding image: " + sourceUri); SvgImageSource SvgImage = null; BitmapImage BitmapImage = null; if (ImageIsSvg) { SvgImage = await AVImage.LoadSvgImage(sourceUri); } else { BitmapImage = await AVImage.LoadBitmapImage(sourceUri, true); } if (SvgImage != null || BitmapImage != null) { ImageContainer img = new ImageContainer(); img.MaxHeight = AppVariables.MaximumItemImageHeight; if (SvgImage != null) { img.item_source.Source = SvgImage; } if (BitmapImage != null) { img.item_source.Source = BitmapImage; } //Get and set alt from the image if (vImageShowAlt && htmlNode.Attributes["alt"] != null) { string AltText = Process.ProcessItemTextSummary(htmlNode.Attributes["alt"].Value, false, false); if (!string.IsNullOrWhiteSpace(AltText)) { img.item_description.Text = AltText; img.item_description.Visibility = Visibility.Visible; } } addElement.Children.Add(img); //GenerateBreak(addElement); } else { ImageContainer img = new ImageContainer(); img.item_status.Text = "Image is not available,\nopen item in browser to view it."; img.IsHitTestVisible = false; addElement.Children.Add(img); //GenerateBreak(addElement); return; } } catch { } }
//Open the popup public async Task OpenPopup(Items Source) { try { System.Diagnostics.Debug.WriteLine("Opening item viewer..."); //Open the popup popup_Main.IsOpen = true; //Focus on the popup iconMenu.Focus(FocusState.Programmatic); //Adjust the swiping direction SwipeBarAdjust(); //Check if the header is hidden if (AppVariables.HeaderHidden) { await HideShowHeader(true); } //Update the status message ProgressDisableUI("Loading the item..."); //Set item source vCurrentItem = Source; txt_AppInfo.Text = ApiMessageError + vCurrentItem.feed_title; //Check if internet is available if (AppVariables.InternetAccess) { iconItem.Visibility = Visibility.Visible; iconBrowser.Visibility = Visibility.Visible; button_LoadFullItem.Visibility = Visibility.Visible; button_OpenInBrowser.Visibility = Visibility.Visible; } else { iconItem.Visibility = Visibility.Collapsed; iconBrowser.Visibility = Visibility.Collapsed; button_LoadFullItem.Visibility = Visibility.Collapsed; button_OpenInBrowser.Visibility = Visibility.Collapsed; } //Update the star status if (vCurrentItem.item_star_status == Visibility.Collapsed) { ToolTipService.SetToolTip(iconStar, "Star item"); iconImageStar.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconStarAdd.png", false); } else { ToolTipService.SetToolTip(iconStar, "Unstar item"); iconImageStar.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconStarRemove.png", false); } iconStar.Visibility = Visibility.Visible; //Load item into the viewer await LoadItem(string.Empty); //Register page events RegisterPageEvents(); //Update the status message ProgressEnableUI(); } catch { System.Diagnostics.Debug.WriteLine("Failed loading item."); ClosePopup(); } }
//Open the popup public async Task OpenPopup(Uri targetUri, Items webSource) { try { if (PopupIsOpen) { Debug.WriteLine("The popup is already open..."); return; } //Check if internet is available if (NetworkInterface.GetIsNetworkAvailable()) { vCurrentWebSource = webSource; txt_AppInfo.Text = webSource.feed_title; //Browse to the uri if (targetUri != null) { webview_Browser.Navigate(targetUri); } else { webview_Browser.Navigate(new Uri(webSource.item_link)); } //Open the popup popup_Main.IsOpen = true; PopupIsOpen = true; //Focus on the popup iconMenu.Focus(FocusState.Programmatic); //Adjust the swiping direction SwipeBarAdjust(); //Check if the header is hidden if (AppVariables.HeaderHidden) { await HideShowHeader(true); } //Update the star status if (vCurrentWebSource.item_star_status == Visibility.Collapsed) { ToolTipService.SetToolTip(iconStar, "Star item"); iconImageStar.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconStarAdd.png", false); } else { ToolTipService.SetToolTip(iconStar, "Unstar item"); iconImageStar.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconStarRemove.png", false); } iconStar.Visibility = Visibility.Visible; //Register page events RegisterPageEvents(); } else { Debug.WriteLine("There is no internet connection available..."); ClosePopup(); return; } } catch { Debug.WriteLine("Failed loading web page."); ClosePopup(); } }
//Load feeds in selection async Task LoadSelectionFeeds(List <TableFeeds> LoadTableFeeds, List <TableItems> LoadTableItems, bool Silent, bool EnableUI) { try { if (!Silent) { await ProgressDisableUI("Loading selection feeds...", true); } Debug.WriteLine("Loading selection feeds, silent: " + Silent); combobox_FeedSelection.IsHitTestVisible = false; combobox_FeedSelection.Opacity = 0.30; await ClearObservableCollection(List_FeedSelect); //Wait for busy database await ApiUpdate.WaitForBusyDatabase(); //Check if received lists are empty if (LoadTableFeeds == null) { LoadTableFeeds = await SQLConnection.Table <TableFeeds>().OrderBy(x => x.feed_folder).ToListAsync(); } if (LoadTableItems == null) { LoadTableItems = await SQLConnection.Table <TableItems>().ToListAsync(); } //Filter un/ignored feeds List <String> IgnoredFeedList = LoadTableFeeds.Where(x => x.feed_ignore_status == true).Select(x => x.feed_id).ToList(); List <TableFeeds> UnignoredFeedList = LoadTableFeeds.Where(x => x.feed_ignore_status == false).ToList(); if (!(bool)AppVariables.ApplicationSettings["DisplayReadMarkedItems"]) { //Add unread feeds selection Feeds TempFeed = new Feeds(); TempFeed.feed_id = "2"; Int32 TotalItemsUnread = ProcessItemLoad.FilterNewsItems(IgnoredFeedList, LoadTableItems, TempFeed, 0, AppVariables.ItemsMaximumLoad).Count(); Feeds FeedItemUnread = new Feeds(); FeedItemUnread.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); FeedItemUnread.feed_title = "All unread items"; FeedItemUnread.feed_item_count = TotalItemsUnread; FeedItemUnread.feed_collection_status = true; FeedItemUnread.feed_id = "2"; List_FeedSelect.Add(FeedItemUnread); //Add read feeds selection TempFeed.feed_id = "1"; Int32 TotalItemsRead = ProcessItemLoad.FilterNewsItems(IgnoredFeedList, LoadTableItems, TempFeed, 0, AppVariables.ItemsMaximumLoad).Count(); Feeds FeedItemRead = new Feeds(); FeedItemRead.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); FeedItemRead.feed_title = "Already read items"; FeedItemRead.feed_item_count = TotalItemsRead; FeedItemRead.feed_collection_status = true; FeedItemRead.feed_id = "1"; List_FeedSelect.Add(FeedItemRead); } else { //Add all feeds selection Feeds TempFeed = new Feeds(); TempFeed.feed_id = "0"; Int32 TotalItemsAll = ProcessItemLoad.FilterNewsItems(IgnoredFeedList, LoadTableItems, TempFeed, 0, AppVariables.ItemsMaximumLoad).Count(); Feeds FeedItemAll = new Feeds(); FeedItemAll.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); FeedItemAll.feed_title = "All feed items"; FeedItemAll.feed_item_count = TotalItemsAll; FeedItemAll.feed_collection_status = true; FeedItemAll.feed_id = "0"; List_FeedSelect.Add(FeedItemAll); } //Feeds that are not ignored and contain items foreach (TableFeeds Feed in UnignoredFeedList) { Feeds TempFeed = new Feeds(); TempFeed.feed_id = Feed.feed_id; Int32 TotalItems = ProcessItemLoad.FilterNewsItems(IgnoredFeedList, LoadTableItems, TempFeed, 0, AppVariables.ItemsMaximumLoad).Count(); if (TotalItems > 0) { //Add folder string FeedFolder = Feed.feed_folder; if (String.IsNullOrWhiteSpace(FeedFolder)) { FeedFolder = "No folder"; } Feeds FolderUpdate = List_FeedSelect.Where(x => x.feed_folder_title == FeedFolder && x.feed_folder_status).FirstOrDefault(); if (FolderUpdate == null) { //Load folder icon BitmapImage FolderIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconFolder-Dark.png", false); //Add folder Feeds FolderItem = new Feeds(); FolderItem.feed_icon = FolderIcon; FolderItem.feed_folder_title = FeedFolder; FolderItem.feed_folder_status = true; List_FeedSelect.Add(FolderItem); //Debug.WriteLine("Added folder..."); } //Add feed //Load feed icon BitmapImage FeedIcon = null; if (Feed.feed_id.StartsWith("user/")) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconUser-Dark.png", false); } else { FeedIcon = await AVImage.LoadBitmapImage("ms-appdata:///local/" + Feed.feed_id + ".png", false); } if (FeedIcon == null) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); } //Get the current feed item count Feeds FeedItem = new Feeds(); FeedItem.feed_icon = FeedIcon; FeedItem.feed_title = Feed.feed_title; FeedItem.feed_item_count = TotalItems; FeedItem.feed_id = Feed.feed_id; List_FeedSelect.Add(FeedItem); //Update folder FolderUpdate = List_FeedSelect.Where(x => x.feed_folder_title == FeedFolder && x.feed_folder_status).FirstOrDefault(); if (FolderUpdate != null) { FolderUpdate.feed_folder_ids.Add(Feed.feed_id); FolderUpdate.feed_item_count = FolderUpdate.feed_item_count + FeedItem.feed_item_count; //Debug.WriteLine("Updated folder..."); } } } combobox_FeedSelection.IsHitTestVisible = true; combobox_FeedSelection.Opacity = 1; } catch { } if (EnableUI) { await ProgressEnableUI(); } }
//Update the feed icon private async void UpdateFeedIcon(object sender, RightTappedRoutedEventArgs e) { try { ListView SendListView = sender as ListView; Feeds SelectedItem = (Feeds)SendListView.SelectedItem; if (SelectedItem != null) { int MsgBoxResult = await new MessagePopup().OpenPopup("Change the feed icon", "Would you like to set a custom feed icon for " + SelectedItem.feed_title + "?", "Set custom icon", "Reset the icon", "", "", "", true); if (MsgBoxResult == 1) { System.Diagnostics.Debug.WriteLine("Changing icon for feed: " + SelectedItem.feed_id + " / " + SelectedItem.feed_title); FileOpenPicker FileOpenPicker = new FileOpenPicker(); FileOpenPicker.ViewMode = PickerViewMode.Thumbnail; FileOpenPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; FileOpenPicker.FileTypeFilter.Add(".png"); //Save and replace feed icon locally StorageFile StorageFile = await FileOpenPicker.PickSingleFileAsync(); if (StorageFile != null) { await StorageFile.CopyAndReplaceAsync(await ApplicationData.Current.LocalFolder.CreateFileAsync(SelectedItem.feed_id + ".png", CreationCollisionOption.ReplaceExisting)); //Load the feed icon BitmapImage FeedIcon = null; if (SelectedItem.feed_id.StartsWith("user/")) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconUser-Dark.png", false); } else { FeedIcon = await AVImage.LoadBitmapImage("ms-appdata:///local/" + SelectedItem.feed_id + ".png", false); } if (FeedIcon == null) { FeedIcon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); } SelectedItem.feed_icon = FeedIcon; } } else if (MsgBoxResult == 2) { //Delete the feed icon IStorageItem LocalFile = await ApplicationData.Current.LocalFolder.TryGetItemAsync(SelectedItem.feed_id + ".png"); if (LocalFile != null) { try { await LocalFile.DeleteAsync(StorageDeleteOption.PermanentDelete); } catch { } } //Load default feed icon SelectedItem.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); //Reset the online status OnlineUpdateFeeds = true; ApiMessageError = string.Empty; await new MessagePopup().OpenPopup("Feed icon reset", "The feed icon has been reset and will be refreshed on the next online feed update, you can refresh the feeds by clicking on the refresh icon above.", "Ok", "", "", "", "", false); } } } catch { } }
//Update the displayed item content public static async Task ScrollViewerUpdateContent(ListView TargetListView, Int32 CurrentOffsetId) { try { Int32 TargetItems = TargetListView.Items.Count(); if (TargetItems > 0) { //Update offset to the current position Int32 OffsetIdNegative = (CurrentOffsetId - AppVariables.ContentToScrollLoad); Int32 OffsetIdPositive = (CurrentOffsetId + AppVariables.ContentToScrollLoad); //Cleanup item content Int32 CheckIdRemove = 0; //Debug.WriteLine("Clearing ListView item content..."); foreach (Items Item in TargetListView.Items) { if (!(CheckIdRemove >= OffsetIdNegative && CheckIdRemove <= OffsetIdPositive)) { if (Item.item_image != null) { Item.item_image.UriSource = null; Item.item_image = null; } if (Item.feed_icon != null) { Item.feed_icon.UriSource = null; Item.feed_icon = null; } } CheckIdRemove++; } //Load item content //Debug.WriteLine("Loading ListView item content..."); for (Int32 i = OffsetIdNegative; i < OffsetIdPositive; i++) { if (i >= 0 && i < TargetItems) { Items AddItem = TargetListView.Items[i] as Items; string ItemImageLink = AddItem.item_image_link; if (AddItem.item_image == null && !String.IsNullOrWhiteSpace(ItemImageLink) && AddItem.item_image_visibility == Visibility.Visible) { AddItem.item_image = await AVImage.LoadBitmapImage(ItemImageLink, false); } if (AddItem.feed_icon == null) { //Load feed icon if (AddItem.feed_id.StartsWith("user/")) { AddItem.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconUser-Dark.png", false); } else { AddItem.feed_icon = await AVImage.LoadBitmapImage("ms-appdata:///local/" + AddItem.feed_id + ".png", false); } if (AddItem.feed_icon == null) { AddItem.feed_icon = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconRSS-Dark.png", false); } } } } } } catch { } }